================
@@ -0,0 +1,178 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+
+namespace gh98199_0{
+inline namespace A {
+  namespace N {}
+}
+inline namespace B {
+  namespace N {}
+}
+namespace N {   // expected-error {{reference to 'N' is ambiguous}}
+    // expected-note@-6 {{candidate found by name lookup is 'gh98199_0::A::N'}}
+    // expected-note@-4 {{candidate found by name lookup is 'gh98199_0::B::N'}}
+  void f();
+}
+}
+
+namespace gh98199_1{
+inline namespace A{
+    inline namespace A_ { namespace N {} }
+    inline namespace A__ { namespace N {} }
+}
+
+inline namespace B{
+    inline namespace B_ { namespace N {} }
+    inline namespace B__ { namespace N {} }
+}
+
+namespace N{    // expected-error {{reference to 'N' is ambiguous}}
+    // expected-note@-10 {{candidate found by name lookup is 
'gh98199_1::A_::N'}}
+    // expected-note@-10 {{candidate found by name lookup is 
'gh98199_1::A__::N'}}
+    // expected-note@-7 {{candidate found by name lookup is 
'gh98199_1::B_::N'}}
+    // expected-note@-7 {{candidate found by name lookup is 
'gh98199_1::B__::N'}}
+}
+}
+
+namespace gh98199_2{
+namespace A{ namespace N{} }
+using namespace A;
+namespace N{}   // no error
----------------
ChenMiaoi wrote:

why does LookupQualifiedName(R, CurContext->getRedeclContext()) find A::N 
through an inline namespace at all — and why doesn’t it find using namespace 
A;’s N (your _2/_3/_14 “no error” cases)?

https://github.com/llvm/llvm-project/pull/234689
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to