[clang] [Clang] Avoid assertion failure for initialized extern aliases (PR #223124)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 18 06:16:38 PDT 2026


================
@@ -7191,7 +7180,7 @@ static void checkAliasAttr(Sema &S, NamedDecl &ND) {
     if (VD->hasInit()) {
       if (const auto *Attr = VD->getAttr<AliasAttr>()) {
         assert(VD->isThisDeclarationADefinition() &&
-               !VD->isExternallyVisible() && "Broken AliasAttr handled late!");
+               "Broken AliasAttr handled late!");
----------------
Fznamznon wrote:

Well I'm not sure removing the assertion is right. It is not right to leave alias attribute on a definition in the first place, so we probably should emit an error earlier, where an attribute is applied to the decl.

https://github.com/llvm/llvm-project/pull/223124


More information about the cfe-commits mailing list