[clang] [clang] pop explicit to keep context stack balance (PR #77312)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 8 17:03:12 PST 2024


https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/77312

>From e31bf72dfadd4f4b9a316917cc0919fdef203498 Mon Sep 17 00:00:00 2001
From: huqizhi <huqizhi at feysh.com>
Date: Mon, 8 Jan 2024 22:15:09 +0800
Subject: [PATCH] [clang] pop explicit to keep context stack balance

---
 clang/lib/Parse/ParseDecl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index b60ae293ef8c20..ed75609d0a538b 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2637,7 +2637,6 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
     T.consumeOpen();
 
     ExprVector Exprs;
-
     InitializerScopeRAII InitScope(*this, D, ThisDecl);
 
     auto ThisVarDecl = dyn_cast_or_null<VarDecl>(ThisDecl);
@@ -2669,6 +2668,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(
             /*Braced=*/false);
         CalledSignatureHelp = true;
       }
+      InitScope.pop();
       Actions.ActOnInitializerError(ThisDecl);
       SkipUntil(tok::r_paren, StopAtSemi);
     } else {



More information about the cfe-commits mailing list