This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

inner class bug in g++


Hello.

There seems to be a bug all versions of g++ related to
protected inner classes. Here is a small example.

class A {
   protected:
      class Ai { };
};
class B : public A::Ai { };

g++ compiles this without error, but others compilers correctly
reject the code.

eccp --strict kill.cc 
"kill.cc", line 6: error: class "A::Ai" is inaccessible
  class B : public A::Ai { };

Here is xlC (vacpp v5) says about this on AIX,
1540-0301: (S) The "protected" member "class A::Ai" cannot be accessed.

I hope that helps.
Mo Dejong
Red Hat Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]