Consider the following code:
class A {
class B {};
};
template <typename C>
class D : A::B {};
void f() {
D<int> d;
}
D<int>
inherits from A::B
which is a private nested class. I was expecting this to be an error, but GCC accepts this code. Is it a bug in GCC or am I missing something?