Hi, Compile the following program: class Foo { private: struct Internal { }; struct Bah { Internal i; }; }; struct Bah { Foo::Internal i; }; The following error message is emitted: foo.cc:3: `struct Foo::Internal' is private foo.cc:10: within this context which translated to English means: 'Foo::Internal' is not accessible from 'Bah'. I understand the following error message should also be emitted according to paragraph 11.8 of ISO C++: foo.cc:3: `struct Foo::Internal' is private foo.cc:6: within this context which translated to English should mean: 'Foo::Internal' is not accessible from 'Foo::Bah'. Thanks.
Pass -O2 -fno-inline -D__NO_STRING_INLINES then. Really, there is nothing glibc can do about this (apart from exporting all those inlines as static functions but that makes no sense) and gcc does not pass any macros which would tell whether -finline or -fno-inline was passed, so it has to use __OPTIMIZE__ (and has done that for ages).
Oops, sorry, this was meant to resolve #25731 and I typed it into a wrong window. I think you're right, my reading of 11.8 tells me the same, I'll look into it soon.
And I was wrong (quoting Jason Merrill): This has changed since the publication of the standard; nested classes now have access to their containing classes.
I've indeed found this: http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#45 However this is only a proposal as I understand it. The standard still applies. Anyway the proposal will probably be changed accordingly so I agree there's no point in adding an error message now and removing it later.