"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
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();
}