Douglas Gregor | ee1828a | 2009-03-10 18:03:33 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
Douglas Gregor | 9813753 | 2009-03-10 18:33:27 +0000 | [diff] [blame^] | 2 | template<typename T> struct A; // expected-note 2{{template is declared here}} |
Douglas Gregor | ee1828a | 2009-03-10 18:03:33 +0000 | [diff] [blame] | 3 | |
Douglas Gregor | 9813753 | 2009-03-10 18:33:27 +0000 | [diff] [blame^] | 4 | template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \ |
| 5 | // expected-error{{implicit instantiation of undefined template 'struct A<X *>'}} |
Douglas Gregor | ee1828a | 2009-03-10 18:03:33 +0000 | [diff] [blame] | 6 | |
| 7 | template<typename T> struct C : B<T> { } ; // expected-note{{instantiation of template class}} |
| 8 | |
| 9 | template<typename T> struct D : C<T> { }; // expected-note{{instantiation of template class}} |
| 10 | |
| 11 | template<typename T> struct E : D<T> { }; // expected-note{{instantiation of template class}} |
| 12 | |
| 13 | template<typename T> struct F : E<T(T)> { }; // expected-note{{instantiation of template class}} |
| 14 | |
| 15 | void f() { |
| 16 | (void)sizeof(F<int>); // expected-note{{instantiation of template class}} |
| 17 | } |
Douglas Gregor | 9813753 | 2009-03-10 18:33:27 +0000 | [diff] [blame^] | 18 | |
| 19 | typedef struct { } X; |
| 20 | |
| 21 | void g() { |
| 22 | (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}} |
| 23 | } |