Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CXX / temp / temp.spec / temp.explicit / p5.cpp
blob5f0c4547cf26f7ceb6f04ef371eaba3ed30f6265
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -Wc++11-compat %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
5 namespace N {
6 template<class T> class Y { // expected-note{{explicit instantiation refers here}}
7 void mf() { }
8 };
11 template class Z<int>; // expected-error{{explicit instantiation of undeclared template class 'Z'}}
13 struct Q;
14 template class Q<int>; // expected-error{{explicit instantiation of non-template class 'Q'}}
16 // FIXME: This example from the standard is wrong; note posted to CWG reflector
17 // on 10/27/2009
18 using N::Y;
19 template class Y<int>;
20 #if __cplusplus <= 199711L
21 // expected-warning@-2 {{explicit instantiation of 'N::Y' must occur in namespace 'N'}}
22 #else
23 // expected-error@-4 {{explicit instantiation of 'N::Y' must occur in namespace 'N'}}
24 #endif
26 template class N::Y<char*>;
27 template void N::Y<double>::mf();