1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
3 // Fun things you can do with inline namespaces:
6 void f1(); // expected-note {{'f1' declared here}}
11 template <typename T
> class C
{};
14 // Specialize and partially specialize somewhere else.
15 template <> class C
<int> {};
16 template <typename T
> class C
<T
*> {};
19 // Qualified and unqualified lookup as if member of enclosing NS.
24 Y::f1(); // expected-error {{no member named 'f1' in namespace 'Y'; did you mean simply 'f1'?}}
32 template <> class C
<float> {};
33 template <typename T
> class C
<T
&> {};
35 template class C
<double>;
38 // As well as all the fun with ADL.
51 inline namespace IL2
{
64 // Let's not forget overload sets.
66 inline namespace Over
{
76 // Don't forget to do correct lookup for redeclarations.
77 namespace redecl
{ inline namespace n1
{
79 template <class Tp
> class allocator
;
85 typedef const void* const_pointer
;
92 typedef Tp
& reference
;
94 void allocate(allocator
<void>::const_pointer
= 0);
99 // Normal redeclarations (not for explicit instantiations or
100 // specializations) are distinct in an inline namespace vs. not in an
103 inline namespace n1
{
106 template<typename T
> void f(T
) { }
107 template<typename T
> struct X2
{ };
114 template<typename T
> void f(T
) { }
115 template<typename T
> struct X2
{ };