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). --- .../CXX/temp/temp.spec/temp.explicit/p3-0x.cpp | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp (limited to 'clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp') diff --git a/clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp b/clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp new file mode 100644 index 0000000..1028830 --- /dev/null +++ b/clang/test/CXX/temp/temp.spec/temp.explicit/p3-0x.cpp @@ -0,0 +1,65 @@ +// RUN: %clang_cc1 -std=c++11 -verify %s + +// If the name declared in the explicit instantiation is an +// unqualified name, the explicit instantiation shall appear in the +// namespace where its template is declared or, if that namespace is +// inline (7.3.1), any namespace from its enclosing namespace set. + +namespace has_inline_namespaces { + inline namespace inner { + template void f(T&) {} + + template + struct X0 { + struct MemberClass {}; + + void mem_func() {} + + template + struct MemberClassTemplate {}; + + template + void mem_func_template(U&) {} + + static int value; + }; + } + + template int X0::value = 17; + + struct X1 {}; + struct X2 {}; + + template void f(X1&); + template void f(X2&); + + template struct X0; + + template struct X0::MemberClass; + + template void X0::mem_func(); + + template struct X0::MemberClassTemplate; + + template void X0::mem_func_template(X1&); + + template int X0::value; +} + +struct X3; +struct X4; + +template void has_inline_namespaces::f(X3&); +template void has_inline_namespaces::f(X4&); + +template struct has_inline_namespaces::X0; + +template struct has_inline_namespaces::X0::MemberClass; + +template void has_inline_namespaces::X0::mem_func(); + +template +struct has_inline_namespaces::X0::MemberClassTemplate; + +template +void has_inline_namespaces::X0::mem_func_template(X3&); -- cgit v1.2.3