Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.explicit / p3-0x.cpp
blob146b6b5da80bd1686d9054e2ed59163b572844ac
1 // RUN: %clang_cc1 -std=c++11 -verify %s
2 // expected-no-diagnostics
4 // If the name declared in the explicit instantiation is an
5 // unqualified name, the explicit instantiation shall appear in the
6 // namespace where its template is declared or, if that namespace is
7 // inline (7.3.1), any namespace from its enclosing namespace set.
9 namespace has_inline_namespaces {
10 inline namespace inner {
11 template<class T> void f(T&) {}
13 template<class T>
14 struct X0 {
15 struct MemberClass {};
17 void mem_func() {}
19 template<typename U>
20 struct MemberClassTemplate {};
22 template<typename U>
23 void mem_func_template(U&) {}
25 static int value;
29 template<typename T> int X0<T>::value = 17;
31 struct X1 {};
32 struct X2 {};
34 template void f(X1&);
35 template void f<X2>(X2&);
37 template struct X0<X1>;
39 template struct X0<X2>::MemberClass;
41 template void X0<X2>::mem_func();
43 template struct X0<X2>::MemberClassTemplate<X1>;
45 template void X0<X2>::mem_func_template(X1&);
47 template int X0<X2>::value;
50 struct X3;
51 struct X4;
53 template void has_inline_namespaces::f(X3&);
54 template void has_inline_namespaces::f<X4>(X4&);
56 template struct has_inline_namespaces::X0<X3>;
58 template struct has_inline_namespaces::X0<X4>::MemberClass;
60 template void has_inline_namespaces::X0<X4>::mem_func();
62 template
63 struct has_inline_namespaces::X0<X4>::MemberClassTemplate<X3>;
65 template
66 void has_inline_namespaces::X0<X4>::mem_func_template(X3&);