Bogus access error

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Fri Mar 12 05:32:00 GMT 1999


I think the following code should compile. On egcs-2.93.11, I get

b.cc: In method `A::B::B()':
b.cc:3: `enum A::Foo A::f1' is inaccessible
b.cc:9: within this context

I've added this as g++.martin/access1.C

Regards,
Martin

class A{
  public:
    enum Foo{f1,f2};

    class B{
      friend class A;
      Foo f;
      public:
        B():f(f1){}
    };
};
 
A::B c;


More information about the Gcc-bugs mailing list