gcc/testsuite/g++.old-deja/g++.pt/typename8.C
raw| 1 | // { dg-do assemble } |
| 2 | |
| 3 | template < class T > class A |
| 4 | { |
| 5 | public: |
| 6 | typedef typename T::myT anotherT; // { dg-error "" } undefined type |
| 7 | |
| 8 | anotherT t; |
| 9 | |
| 10 | A() { } |
| 11 | A(anotherT _t) { |
| 12 | t=_t; |
| 13 | } |
| 14 | |
| 15 | anotherT getT() { |
| 16 | return t; |
| 17 | } |
| 18 | }; |
| 19 | |
| 20 | class B : public A< B > // { dg-message "" } forward declaration |
| 21 | { |
| 22 | public: |
| 23 | typedef int myT; |
| 24 | }; |
| 25 | |
| 26 | int main() { |
| 27 | B b; |
| 28 | } |