blob: 93f9a3552aa04cdcada5763ef33f1d5b27eacf76 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -verify %s
2template<typename T> struct A; // expected-note 4{{template is declared here}}
3
4template<typename T> struct B : A<T*> { }; // expected-error{{implicit instantiation of undefined template}} \
5// expected-error{{implicit instantiation of undefined template 'struct A<X *>'}}
6
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}
18
19typedef struct { } X;
20
21void g() {
22 (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'struct B<X>' requested here}}
23}
24
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}