[clang] [clang-repl] Undo the enumerators of an unscoped enumeration (PR #228370)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 7 00:49:40 PDT 2026


================
@@ -291,6 +291,12 @@ class ASTDeclUnmerger : public DeclVisitor<ASTDeclUnmerger> {
   void VisitVarDecl(VarDecl *D) { withdraw(D); }
 
   void VisitTagDecl(TagDecl *D) {
+    // The enumerators of an unscoped enumeration are visible in the enclosing
+    // context.
+    if (auto *ED = dyn_cast<EnumDecl>(D);
+        ED && ED->isThisDeclarationADefinition())
+      VisitDeclContext(ED);
----------------
vgvassilev wrote:

Actually I suspect that we should call `VisitDeclContext` for all complete tag decls. Should not be an enum-specific requirement.

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


More information about the cfe-commits mailing list