Skip to content

Commit

Permalink
[TCling] Add test for root-project#8367
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo authored and devajithvs committed Sep 26, 2024
1 parent d994e9c commit 0d357e3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/metacling/test/TClingTests.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,16 @@ const Constructor c19(19);
EXPECT_EQ(constructors[i], i);
}
}

// #8367
TEST_F(TClingTests, UndeclaredIdentifierCrash)
{
auto expectedError = R"(error: use of undeclared identifier 'i'
for(i=0; i < 0;); // the second usage of `i` was enough to get a segfault
^
)";
using namespace ROOT::TestSupport;
CheckDiagsRAII diagRAII;
diagRAII.requiredDiag(kError, "cling", expectedError, false);
gInterpreter->ProcessLine("for(i=0; i < 0;); // the second usage of `i` was enough to get a segfault");
}

0 comments on commit 0d357e3

Please sign in to comment.