1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
2 
3 template<typename T>
4 struct X0 {
5   void f(T &t) {
6     t = 1; // expected-error{{incompatible type}}
7   }
8 
9   void g(T &t);
10 
11   void h(T &t);
12 
13   static T static_var;
14 };
15 
16 template<typename T>
17 inline void X0<T>::g(T & t) {
18   t = 1; // expected-error{{incompatible type}}
19 }
20 
21 template<typename T>
22 void X0<T>::h(T & t) {
23   t = 1;
24 }
25 
26 template<typename T>
27 T X0<T>::static_var = 1;
28 
29 extern template struct X0<int*>;
30 
31 int *&test(X0<int*> xi, int *ip) {
32   xi.f(ip); // expected-note{{instantiation}}
33   xi.g(ip); // expected-note{{instantiation}}
34   xi.h(ip);
35   return X0<int*>::static_var;
36 }
37 
38 template<typename T>
39 void f0(T& t) {
40   t = 1; // expected-error{{incompatible type}}
41 }
42 
43 template<typename T>
44 inline void f1(T& t) {
45   t = 1; // expected-error 2{{incompatible type}}
46 }
47 
48 extern template void f0<>(int *&);
49 extern template void f1<>(int *&);
50 
51 void test_f0(int *ip, float *fp) {
52   f0(ip);
53   f0(fp); // expected-note{{instantiation}}
54 }
55 
56 void test_f1(int *ip, float *fp) {
57   f1(ip); // expected-note{{instantiation}}
58   f1(fp); // expected-note{{instantiation}}
59 }
60