1 // RUN: %clang_cc1 -fsyntax-only -verify %s
16 int &use_X0_int(X0
<int> x0i
, // expected-note{{implicit instantiation first required here}}
18 x0i
.f(); // expected-note{{implicit instantiation first required here}}
19 x0i
.g(i
); // expected-note{{implicit instantiation first required here}}
20 X0
<int>::Nested nested
; // expected-note{{implicit instantiation first required here}}
21 return X0
<int>::member
; // expected-note{{implicit instantiation first required here}}
25 void X0
<int>::f() { // expected-error{{after instantiation}}
29 void X0
<int>::g(int) { // expected-error{{after instantiation}}
33 struct X0
<int>::Nested
{ }; // expected-error{{after instantiation}}
36 int X0
<int>::member
= 17; // expected-error{{after instantiation}}
39 struct X0
<int> { }; // expected-error{{after instantiation}}
41 // Example from the standard
42 template<class T
> class Array
{ /* ... */ };
44 template<class T
> void sort(Array
<T
>& v
) { /* ... */ }
48 void f(Array
<String
>& v
) {
50 sort(v
); // expected-note{{required}}
51 // use primary template
52 // sort(Array<T>&), T is String
55 template<> void sort
<String
>(Array
<String
>& v
); // // expected-error{{after instantiation}}
56 template<> void sort
<>(Array
<char*>& v
); // OK: sort<char*> not yet used
59 template<typename T
> void f(T
);
60 template<> void f(int);
61 extern template void f(int);
62 template<> void f(int) { }