そのようなネストされたクラスを前方宣言することはできません。
何をしようとしているのかによっては、外側のレイヤーでクラスではなく名前空間を使用できる場合があります。そのようなクラスを問題なく前方宣言できます。
namespace Outer {
struct Inner;
};
Outer::Inner* sweets; // Outer::Inner is incomplete so
// I can only make a pointer to it
Outer が絶対にクラスである必要があり、それを名前空間に押し込むことができない場合は、Inner を前方宣言するコンテキストで Outer を完全な型にする必要があります。
class Outer
{
class Inner; // Inner forward-declared
}; // Outer is fully-defined now
Outer yes; // Outer is complete, you can make instances of it
Outer::Inner* fun; // Inner is incomplete, you can only make
// pointers/references to it
class Outer::Inner
{
}; // now Inner is fully-defined too
Outer::Inner win; // Now I can make instances of Inner too