diff --git a/test/testgarbage.cpp b/test/testgarbage.cpp index 145dc2e20..2ed5034d5 100644 --- a/test/testgarbage.cpp +++ b/test/testgarbage.cpp @@ -221,6 +221,7 @@ private: TEST_CASE(garbageCode170); TEST_CASE(garbageCode171); TEST_CASE(garbageCode172); + TEST_CASE(garbageCode173); // #6781 TEST_CASE(garbageValueFlow); TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageAST); @@ -1454,6 +1455,11 @@ private: ASSERT_THROW(checkCode("p>,"), InternalError); } + void garbageCode173() { + // #6781 heap corruption ; TemplateSimplifier::simplifyTemplateInstantiations + ASSERT_THROW(checkCode(" template < Types > struct S : >( S < ...Types... > S <) > { ( ) { } } ( ) { return S < void > ( ) }"), InternalError); + } + }; REGISTER_TEST(TestGarbage)