From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- .../test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp (limited to 'clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp') diff --git a/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp new file mode 100644 index 0000000..c7597e9 --- /dev/null +++ b/clang/test/CXX/temp/temp.spec/temp.expl.spec/p16.cpp @@ -0,0 +1,38 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +template struct A { + void f(T); + template void g1(T, X1); + template void g2(T, X2); + void h(T) { } +}; + +// specialization +template<> void A::f(int); + +// out of class member template definition +template template void A::g1(T, X1) { } + +// member template specialization +template<> template void A::g1(int, X1); + +// member template specialization +template<> template<> + void A::g1(int, char); // X1 deduced as char + +template<> template<> + void A::g2(int, char); // X2 specified as char + // member specialization even if defined in class definition + +template<> void A::h(int) { } + +namespace PR10024 { + template + struct Test{ + template + void get(U i) {} + }; + + template + template <> + void Test::get(double i) {} // expected-error{{cannot specialize (with 'template<>') a member of an unspecialized template}} +} -- cgit v1.2.3