[clang] [clang] Diagnose when spelled 'abi_tag' on namespace doesn't match applied one. (PR #221039)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 30 09:00:55 PDT 2026
================
@@ -2961,11 +2961,13 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D,
AA->getDeprecated(), AA->getObsoleted(), AA->getUnavailable(),
AA->getMessage(), AA->getStrict(), AA->getReplacement(), AMK,
AA->getPriority(), AA->getEnvironment(), InferredPlatformII);
- } else if (const auto *VA = dyn_cast<VisibilityAttr>(Attr))
- NewAttr = S.mergeVisibilityAttr(D, *VA, VA->getVisibility());
- else if (const auto *VA = dyn_cast<TypeVisibilityAttr>(Attr))
- NewAttr = S.mergeTypeVisibilityAttr(D, *VA, VA->getVisibility());
- else if (const auto *ImportA = dyn_cast<DLLImportAttr>(Attr))
+ } else if (const auto *VA = dyn_cast<VisibilityAttr>(Attr)) {
+ if (!isa<NamespaceDecl>(D))
----------------
AaronBallman wrote:
This logic should not live here, it should be part of `mergeVisibilityAttr` if anywhere.
https://github.com/llvm/llvm-project/pull/221039
More information about the cfe-commits
mailing list