Re: Insufficient access check for private static member in base class

2012-05-18 Thread Ian Lance Taylor
"Peter A. Felvegi" writes: > All versions I've tried (4.4, 4.5, 4.6, 4.7) compiles the code. clang > gives proper diagnostic stating that Base::foo is private. > > If base::foo is not static, gcc catches the error, too: > gccacbug.cpp: In member function ‘int DerivT::Foo() [with T = void]’: > gcc

Insufficient access check for private static member in base class

2012-05-18 Thread Peter A. Felvegi
Hello, I've bumped into the following: 8<8<8<8< class Base { static int foo; }; #if 0 class Deriv : public Base { public: int Foo() { return foo; } }; #endif template class DerivT : public Base { public: int Foo() { return foo; } }; void bar() { DerivT dt; dt.Foo(); }