Skip to content

Commit c97b32c

Browse files
committed
[TCling] Add test for #8367
1 parent 13af1b8 commit c97b32c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

core/metacling/test/TClingTests.cxx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,3 +409,16 @@ const Constructor c19(19);
409409
EXPECT_EQ(constructors[i], i);
410410
}
411411
}
412+
413+
// #8367
414+
TEST_F(TClingTests, UndeclaredIdentifierCrash)
415+
{
416+
auto expectedError = R"(input_line_30:2:11: error: use of undeclared identifier 'i'
417+
for(i=0; i < 0;); // the second usage of `i` was enough to get a segfault
418+
^
419+
)";
420+
using namespace ROOT::TestSupport;
421+
CheckDiagsRAII diagRAII;
422+
diagRAII.requiredDiag(kError, "cling", expectedError, false);
423+
gInterpreter->ProcessLine("for(i=0; i < 0;); // the second usage of `i` was enough to get a segfault");
424+
}

0 commit comments

Comments
 (0)