xref: /openbsd-src/gnu/usr.bin/gcc/gcc/testsuite/g++.old-deja/g++.pt/typename8.C (revision c87b03e512fc05ed6e0222f6fb0ae86264b1d05b)
1 // Build don't link:
2 
3 template < class T > class A
4 {
5 public:
6   typedef typename T::myT anotherT; // ERROR - undefined type
7 
8   anotherT t; // ERROR - undefined type
9 
A()10   A() { }
A(anotherT _t)11   A(anotherT _t) { // ERROR - undefined type
12     t=_t;
13   }
14 
getT()15   anotherT getT() { // ERROR - undefined type
16     return t;
17   }
18 };
19 
20 class B : public A< B > // ERROR - forward declaration
21 {
22 public:
23   typedef int myT;
24 };
25 
main()26 int main() {
27   B b;
28 }
29