aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/template/access2.C
blob: 0b4657d1a8a4335bf1440f2e07362b552ae4bb3e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// { 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-message "required" }
  ab.f();				// { dg-message "required" }
}