aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/parse/error36.C
blob: 92e27a928dfce41d3054fe9d87bb38f90f4bde3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// PR c++/15946
// Test for helpful error message about missing typename.

template <class T> struct A
{
  struct B { };
  static B b;
};

template <class T>
void f(T t)
{
  typedef A<T>::foo type;	// { dg-error "typename" }
  A<T>::bar b;			// { dg-error "typename" "typename" }
} // { dg-error "expected ';'" "expected" { target *-*-* } 14 }

// PR c++/36353
template <class T> struct B
{
  void f()
  {
    A<T>::baz z;		// { dg-error "typename" "typename" }
  } // { dg-error "expected ';'" "expected" { target *-*-* } 22 }
};

// PR c++/40738
template <class T>
void g(const A<T>::type &t);	// { dg-error "typename" "typename" }

// PR c++/18451
template <class T> A<T>::B A<T>::b; // { dg-error "typename" }