================
@@ -12832,6 +12833,15 @@ bool Sema::CheckUsingShadowDecl(BaseUsingDecl *BUD,
NamedDecl *Orig,
(isa_and_nonnull<UnresolvedUsingIfExistsDecl>(NonTag))) {
if (!NonTag && !Tag)
return false;
+
+ // Only report the error if this using_if_exists decl can be a
+ // substitute for the original decl. LookupResult will find things with
+ // the same name but we also want to take into account namespaces and
+ // other scopes. GlobalDecl helps take care of that.
+ NamedDecl *UsedTag = NonTag ? NonTag : Tag;
+ if (GlobalDecl(Target) != GlobalDecl(UsedTag))
+ return false;
+
Diag(BUD->getLocation(), diag::err_using_decl_conflict);
----------------
Fznamznon wrote:
Is this error ever emitted now?
https://github.com/llvm/llvm-project/pull/167646
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits