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
&) {}
15 struct MemberClass
{};
20 struct MemberClassTemplate
{};
23 void mem_func_template(U
&) {}
29 template<typename T
> int X0
<T
>::value
= 17;
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
;
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();
63 struct has_inline_namespaces::X0
<X4
>::MemberClassTemplate
<X3
>;
66 void has_inline_namespaces::X0
<X4
>::mem_func_template(X3
&);