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
// { dg-do assemble } template < class T > class A { public: typedef typename T::myT anotherT; // { dg-error "" } undefined type anotherT t; A() { } A(anotherT _t) { t=_t; } anotherT getT() { return t; } }; class B : public A< B > // { dg-error "" } forward declaration { public: typedef int myT; }; int main() { B b; }