Delete unused PoisonChecking utility pass
[llvm-project.git] / clang / test / CXX / temp / temp.spec / p5.cpp
blobba92d41e3e8e328da7b0d7ffa6be330a663529c5
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 template<typename T> inline void f(T) { }
4 template void f(int); // expected-note{{previous explicit instantiation}}
5 template void f(int); // expected-error{{duplicate explicit instantiation}}
7 template<typename T>
8 struct X0 {
9 union Inner { };
11 void f(T) { }
13 static T value;
16 template<typename T>
17 T X0<T>::value = 3.14; // expected-warning{{implicit conversion from 'double' to 'int' changes value from 3.14 to 3}}
19 template struct X0<int>; // expected-note{{previous explicit instantiation}} \
20 expected-note{{requested here}}
21 template struct X0<int>; // expected-error{{duplicate explicit instantiation}}
23 template void X0<float>::f(float); // expected-note{{previous explicit instantiation}}
24 template void X0<float>::f(float); // expected-error{{duplicate explicit instantiation}}
26 template union X0<float>::Inner; // expected-note{{previous explicit instantiation}}
27 template union X0<float>::Inner; // expected-error{{duplicate explicit instantiation}}
29 template float X0<float>::value; // expected-note{{previous explicit instantiation}}
30 template float X0<float>::value; // expected-error{{duplicate explicit instantiation}}
32 // Make sure that we don't get tricked by redeclarations of nested classes.
33 namespace NestedClassRedecls {
34 template<typename T>
35 struct X {
36 struct Nested;
37 friend struct Nested;
39 struct Nested {
40 Nested() {}
41 } nested;
44 X<int> xi;
46 template struct X<int>;