[clang] [clang] Fix ASTWriter crash after merging named enums (PR #114240)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 24 09:30:06 PST 2025
================
@@ -2551,18 +2551,7 @@ void Sema::MergeTypedefNameDecl(Scope *S, TypedefNameDecl *New,
// Make the old tag definition visible.
makeMergedDefinitionVisible(Hidden);
- // If this was an unscoped enumeration, yank all of its enumerators
- // out of the scope.
- if (isa<EnumDecl>(NewTag)) {
- Scope *EnumScope = getNonFieldDeclScope(S);
- for (auto *D : NewTag->decls()) {
- auto *ED = cast<EnumConstantDecl>(D);
- assert(EnumScope->isDeclScope(ED));
- EnumScope->RemoveDecl(ED);
- IdResolver.RemoveDecl(ED);
- ED->getLexicalDeclContext()->removeDecl(ED);
----------------
ilya-biryukov wrote:
Sure, happy to run this over our codebase. Will report back after a day or two.
https://github.com/llvm/llvm-project/pull/114240
More information about the cfe-commits
mailing list