Author: Douglas Yung Date: 2026-10-10T05:34:55Z New Revision: 095663b9da1ab76c8bf9bb73993027516c5376ef
URL: https://github.com/llvm/llvm-project/commit/095663b9da1ab76c8bf9bb73993027516c5376ef DIFF: https://github.com/llvm/llvm-project/commit/095663b9da1ab76c8bf9bb73993027516c5376ef.diff LOG: Revert "[clang-repl] Fix crashing on unusable top-level declarations" (#230734) Reverts llvm/llvm-project#230054 This is causing a test failure on a Windows bot: https://lab.llvm.org/buildbot/#/builders/46/builds/42541 Added: Modified: clang/lib/Parse/ParseDecl.cpp clang/test/Interpreter/execute.cpp Removed: ################################################################################ diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index a3567d618cfa52..2f326451c3f13d 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -5873,10 +5873,8 @@ Parser::DeclGroupPtrTy Parser::ParseTopLevelStmtDecl() { TopLevelStmtDecl *TLSD = Actions.ActOnStartTopLevelStmtDecl(getCurScope()); StmtResult R = ParseStatementOrDeclaration(Stmts, SubStmtCtx); Actions.ActOnFinishTopLevelStmtDecl(TLSD, R.get()); - if (!R.isUsable()) { + if (!R.isUsable()) R = Actions.ActOnNullStmt(Tok.getLocation()); - TLSD->setStmt(R.get()); - } if (Tok.is(tok::annot_repl_input_end) && Tok.getAnnotationValue() != nullptr) { diff --git a/clang/test/Interpreter/execute.cpp b/clang/test/Interpreter/execute.cpp index 65dbc2d70a90f1..82cd70a93980a7 100644 --- a/clang/test/Interpreter/execute.cpp +++ b/clang/test/Interpreter/execute.cpp @@ -19,7 +19,3 @@ auto r2 = printf("S[f=%f, m=0x%llx]\n", s.f, reinterpret_cast<unsigned long long inline int foo() { return 42; } int r3 = foo(); - -return; -printf("not crashed\n"); -// CHECK-NEXT: not crashed _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
