Bug report (or is it?) - private scope

Philippe Bouchard boucp00@DMI.USherb.CA
Thu Nov 11 09:51:00 GMT 1999


I don't want to say that it is a bug, but it looks a little illogical.
Here's the source:
#include <iostream.h>
class A {
   struct B {
      void func() {
         cout<<__PRETTY_FUNCTION__<<endl;
}
      };
   };
void main() {
   A::B b;
   b.func();
   }
Everything works and outputs:
void A::B::func()
The members of structure A::B (constructor and void func()) are not
supposed to have limited access to class A?
PAB



More information about the Gcc-bugs mailing list