9.2.2
A class is considered a completely-defined object type (3.9) (or complete type) at the closing } of the class-specifier. Within the class member-specification, the class is regarded as complete within function bodies, default arguments, exception-specifications, and brace-or-equal-initializers for non-static data members (including such things in nested classes). Otherwise it is regarded as incomplete within its own class member-specification.
You're thinking about this as though it was a top-down interpreted language.
C++ uses single pass compilation model. That is why forward declarations are needed. For compiler nothing yet exist after current line. It is just some things inside class definition which are exception.
For compiler nothing yet exist after current line.
This doesn't conflict with my earlier comment.
A traditional interpreter executes the code as you go along
A compiler creates object files that still require link stage, perhaps even dynamic library loading at run-time.
If you went along "executing" the code in your head as you read it, it follows you might think the code was being executed in the same way by the CPU and ask the question that was asked.
The real point I was trying to prompt OP to think about is the quote from the standard:
Within the class member-specification, the class is regarded as complete within function bodies