57 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s2 3// C++11 [basic.lookup.argdep]p24//5// [...] If an associated namespace is an inline namespace (10.3.1), its6// enclosing namespace is also included in the set. If an associated7// namespace directly contains inline namespaces, those inline namespaces8// are also included in the set.9 10namespace test1 {11 namespace L {12 namespace M {13 inline namespace N {14 inline namespace O {15 struct S {};16 void f1(S);17 }18 void f2(S);19 }20 void f3(S);21 }22 void f4(M::S); // expected-note {{declared here}}23 }24 25 void test() {26 L::M::S s;27 f1(s); // ok28 f2(s); // ok29 f3(s); // ok30 f4(s); // expected-error {{use of undeclared}}31 }32}33 34namespace test2 {35 namespace L {36 struct S {};37 inline namespace M {38 inline namespace N {39 inline namespace O {40 void f1(S);41 }42 void f2(S);43 }44 void f3(S);45 }46 void f4(S);47 }48 49 void test() {50 L::S s;51 f1(s); // ok52 f2(s); // ok53 f3(s); // ok54 f4(s); // ok55 }56}57