Is declaring a static field of a type that is incomplete at the moment of the class definition legal in C++? For example:
Foo.h:
class Foo
{
public:
// ...
private:
class Bar;
static Bar something;
};
Foo.cpp:
class Foo::Bar
{
// ...
};
Foo::Bar Foo::something;
// some more code
Compilers seem to accept it, and I don't see a reason for which it should be rejected, but what does the standard say about such situation? I'd really appreciate someone giving a direct quote from the standard, preferably from the "old" one (the one from 2003).