if (UsingShadowDecl *Shadow = dyn_cast<UsingShadowDecl>(*I))
PrevShadow = Shadow;
FoundEquivalentDecl = true;
+ } else if (isEquivalentInternalLinkageDeclaration(D, Target)) {
+ // We don't conflict with an existing using shadow decl of an equivalent
+ // declaration, but we're not a redeclaration of it.
+ FoundEquivalentDecl = true;
}
if (isVisible(D))
struct string {};
-namespace N { typedef ::string clstring; }
+const int n = 0;
+namespace N { typedef ::string clstring; using ::n; }
--- /dev/null
+#include "a.h"
module a { header "a.h" }
-module b { header "b.h" export * }
-module c { header "c.h" export * }
+module b { header "b.h" export a }
+module c { header "c.h" export a export b }
+module d { header "d.h" }
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t \
// RUN: -fmodule-map-file=%S/Inputs/using-decl-redecl/module.modulemap \
// RUN: -I%S/Inputs/using-decl-redecl \
+// RUN: -Wno-modules-ambiguous-internal-linkage \
// RUN: -verify %s
+
+#include "d.h"
+
+const int n = 0;
+namespace M { using ::n; }
+
#include "c.h"
+
N::clstring y = b;
// Use a typo to trigger import of all declarations in N.
N::clstrinh s; // expected-error {{did you mean 'clstring'}}
-// expected-note@a.h:2 {{here}}
+// expected-note@a.h:3 {{here}}
+
+namespace M { using N::n; }