[clang] [clang-repl] Remove invalid TopLevelStmtDecl from TU on parse failure (PR #153945)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 16 23:58:45 PDT 2025


================
@@ -91,6 +93,53 @@ TEST_F(InterpreterTest, IncrementalInputTopLevelDecls) {
   EXPECT_EQ("var2", DeclToString(*R2DeclRange.begin()));
 }
 
+TEST_F(InterpreterTest, BadIncludeDoesNotCorruptTU) {
----------------
vgvassilev wrote:

Can we extend either `clang/test/Interpreter/execute.c` or `clang/test/Interpreter/fail.cpp` tests instead? I think it would be simpler to write and maintain.

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


More information about the cfe-commits mailing list