@@ -220,6 +220,7 @@ class TestGarbage : public TestFixture {
220220 TEST_CASE (garbageCode169); // #6731
221221 TEST_CASE (garbageCode170);
222222 TEST_CASE (garbageCode171);
223+ TEST_CASE (garbageCode172);
223224 TEST_CASE (garbageValueFlow);
224225 TEST_CASE (garbageSymbolDatabase);
225226 TEST_CASE (garbageAST);
@@ -228,10 +229,10 @@ class TestGarbage : public TestFixture {
228229
229230 std::string checkCode (const char code[], bool cpp = true ) {
230231 // double the tests - run each example as C as well as C++
231- const char * filename = cpp ? " test.cpp" : " test.c" ;
232- const char * alternatefilename = cpp ? " test.c" : " test.cpp" ;
232+ const char * const filename = cpp ? " test.cpp" : " test.c" ;
233+ const char * const alternatefilename = cpp ? " test.c" : " test.cpp" ;
233234
234- // run alternate check first. It should only ensure stability
235+ // run alternate check first. It should only ensure stability - so we catch exceptions here.
235236 try {
236237 checkCodeInternal (code, alternatefilename);
237238 } catch (InternalError&) {
@@ -1448,6 +1449,11 @@ class TestGarbage : public TestFixture {
14481449 ASSERT_THROW (checkCode (" (){case()?():}:" , false ), InternalError);
14491450 }
14501451
1452+ void garbageCode172 () {
1453+ // #7357
1454+ ASSERT_THROW (checkCode (" p<e T=l[<]<>>," ), InternalError);
1455+ }
1456+
14511457};
14521458
14531459REGISTER_TEST (TestGarbage)
0 commit comments