blob: 869662268dd24b805c5994a3a867772bd4a660c0 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Douglas Gregor27b152f2009-03-10 18:52:44 +00002template<typename T> struct A; // expected-note 4{{template is declared here}}
Douglas Gregoree1828a2009-03-10 18:03:33 +00003
Douglas Gregor98137532009-03-10 18:33:27 +00004template<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 Gregoree1828a2009-03-10 18:03:33 +00006
7template<typename T> struct C : B<T> { } ; // expected-note{{instantiation of template class}}
8
9template<typename T> struct D : C<T> { }; // expected-note{{instantiation of template class}}
10
11template<typename T> struct E : D<T> { }; // expected-note{{instantiation of template class}}
12
13template<typename T> struct F : E<T(T)> { }; // expected-note{{instantiation of template class}}
14
15void f() {
16 (void)sizeof(F<int>); // expected-note{{instantiation of template class}}
17}
Douglas Gregor98137532009-03-10 18:33:27 +000018
19typedef struct { } X;
20
21void g() {
22 (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}}
23}
Douglas Gregor27b152f2009-03-10 18:52:44 +000024
25template<typename T>
26struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'struct A<int>'}}
27 A<T*> // expected-error{{implicit instantiation of undefined template 'struct A<int *>'}}
28 { };
29
30void h() {
31 (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'struct G<int>' requested here}}
32}