1 // PR c++/15946 2 // Test for helpful error message about missing typename. 3 4 template <class T> struct A 5 { 6 struct B { }; 7 static B b; 8 }; 9 10 template <class T> f(T t)11void f(T t) 12 { 13 typedef A<T>::foo type; // { dg-error "typename" } 14 A<T>::bar b; // { dg-error "typename" "typename" } 15 } // { dg-error "expected ';'" "expected" { target *-*-* } .-1 } 16 17 // PR c++/36353 18 template <class T> struct B 19 { fB20 void f() 21 { 22 A<T>::baz z; // { dg-error "typename" "typename" } 23 } // { dg-error "expected ';'" "expected" { target *-*-* } .-1 } 24 }; 25 26 // PR c++/40738 27 template <class T> 28 void g(const A<T>::type &t); // { dg-error "typename" } 29 30 // PR c++/18451 31 template <class T> A<T>::B A<T>::b; // { dg-error "typename" "" { target c++17_down } } 32