diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 1d62a053d..d3163b027 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -164,6 +164,7 @@ private: TEST_CASE(garbageCode122); // #6303 TEST_CASE(garbageCode123); TEST_CASE(garbageCode124); // 6948 + TEST_CASE(garbageCode125); // 6782, 6834 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); @@ -938,6 +939,13 @@ private: checkCode("+---+"); } + void garbageCode125() { + ASSERT_THROW(checkCode("{ T struct B : T valueA_AA ; } T : [ T > ( ) { B } template < T > struct A < > : ] { ( ) { return valueA_AC struct { : } } b A < int > AC ( ) a_aa.M ; ( ) ( ) }"), + InternalError); + ASSERT_THROW(checkCode("template < Types > struct S :{ ( S < ) S >} { ( ) { } } ( ) { return S < void > ( ) }"), + InternalError); + } + void garbageValueFlow() { // #6089 const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"