TITLE: Accessibility of private return types PROBLEM: u865151@student.canberra.edu.au (Burger / John Adrian (ISE)) class Test { public: Test(); private: typedef int TestType; TestType Works() { return 0; } TestType DoesNot(); }; Test::TestType Test::DoesNot() { return 0; } On all compilers, Works compiles, but on some (gnu in particular, from memory), DoesNot returns a compiler error when trying to define it: something along the lines of "Test::TestType not accessible out of scope." I don't see an access violation in the intent (DoesNot is a member of Test), just in the syntax (it's used before it's obvious that it's OK). RESPONSE: clamage@Eng.Sun.COM (Steve Clamage), 23 Jan 95 Under the rules of the ARM, you cannot define Test::DoesNot outside the class, because the return type is not accessible at file scope. This makes private types considerably less useful, and the C++ Committee recently adopted the rule that you could define such functions outside the class. That is, the decision about accessibility of Test::TestType is delayed until it is known what is being declared. (There was such a rule already in place for private static members, and the rules was extended.)