Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.explicit / p9.cpp
blob3e9b4f8fccf41db027490a4dd98c9ade1e806ea6
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s
3 template<typename T>
4 struct X0 {
5 void f(T &t) {
6 t = 1; // expected-error{{incompatible integer to pointer conversion}}
9 void g(T &t);
11 void h(T &t);
13 static T static_var;
16 template<typename T>
17 inline void X0<T>::g(T & t) {
18 t = 1; // expected-error{{incompatible integer to pointer conversion}}
21 template<typename T>
22 void X0<T>::h(T & t) {
23 t = 1;
26 template<typename T>
27 T X0<T>::static_var = 1;
29 extern template struct X0<int*>;
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;
38 template<typename T>
39 void f0(T& t) {
40 t = 1; // expected-error{{incompatible integer to pointer conversion}}
43 template<typename T>
44 inline void f1(T& t) {
45 t = 1; // expected-error 2{{incompatible integer to pointer conversion}}
48 extern template void f0<>(int *&);
49 extern template void f1<>(int *&);
51 void test_f0(int *ip, float *fp) {
52 f0(ip);
53 f0(fp); // expected-note{{instantiation}}
56 void test_f1(int *ip, float *fp) {
57 f1(ip); // expected-note{{instantiation}}
58 f1(fp); // expected-note{{instantiation}}