blob: 9da8ecf58bf7895f6a660deb6d947ed893a3a901 [file] [log] [blame]
// { dg-do compile }
// PR c++/5387
// Enforcing access of typename type.
template <class T> struct A {
typename T::X x; // { dg-error "this context" }
int f() { return T::i; } // { dg-error "this context" }
};
class B {
typedef int X; // { dg-error "private" }
static int i; // { dg-error "private" }
};
int main()
{
A<B> ab; // { dg-error "instantiated" }
ab.f(); // { dg-error "instantiated" }
}