blob: 21456e902ae5535cf496f5a672a75e17ca759585 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -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}} \
John McCall7c2342d2010-03-10 11:27:22 +00005// expected-error{{implicit instantiation of undefined template '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() {
John McCall7c2342d2010-03-10 11:27:22 +000022 (void)sizeof(B<X>); // expected-note{{in instantiation of template class 'B<X>' requested here}}
Douglas Gregor98137532009-03-10 18:33:27 +000023}
Douglas Gregor27b152f2009-03-10 18:52:44 +000024
25template<typename T>
John McCall7c2342d2010-03-10 11:27:22 +000026struct G : A<T>, // expected-error{{implicit instantiation of undefined template 'A<int>'}}
27 A<T*> // expected-error{{implicit instantiation of undefined template 'A<int *>'}}
Douglas Gregor27b152f2009-03-10 18:52:44 +000028 { };
29
30void h() {
John McCall7c2342d2010-03-10 11:27:22 +000031 (void)sizeof(G<int>); // expected-note{{in instantiation of template class 'G<int>' requested here}}
Douglas Gregor27b152f2009-03-10 18:52:44 +000032}