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]

C++: current 2.96 now too strict at access control


Things possible for global functions should
not be impossible for any member function.

Here is the example for the regression:

------
struct A {};

struct B : private A {};

struct C : B {
  void f()
  {
    C c;
    A a;             //should pass
    A* ap = (A*) &c; //should pass
  }
};

------

with gcc version 2.96 20000223 (experimental)
this gives:

> g++ bug.cpp
bug.cpp: In method `void C::f ()':
bug.cpp:1: `struct A' is inaccessible
bug.cpp:9: within this context
bug.cpp:1: `struct A' is inaccessible
bug.cpp:10: within this context
bug.cpp:1: `struct A' is inaccessible
bug.cpp:10: within this context

Alfred

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