testrunner: add testcode for #6781 (TemplateSimplifier::simplifyTemplateInstantiations causes heap corruption on invalid code)

This commit is contained in:
Matthias Krüger 2016-01-30 18:20:45 +01:00
parent b82bdb222a
commit 112b35a49e
1 changed files with 6 additions and 0 deletions

View File

@ -221,6 +221,7 @@ private:
TEST_CASE(garbageCode170); TEST_CASE(garbageCode170);
TEST_CASE(garbageCode171); TEST_CASE(garbageCode171);
TEST_CASE(garbageCode172); TEST_CASE(garbageCode172);
TEST_CASE(garbageCode173); // #6781
TEST_CASE(garbageValueFlow); TEST_CASE(garbageValueFlow);
TEST_CASE(garbageSymbolDatabase); TEST_CASE(garbageSymbolDatabase);
TEST_CASE(garbageAST); TEST_CASE(garbageAST);
@ -1454,6 +1455,11 @@ private:
ASSERT_THROW(checkCode("p<e T=l[<]<>>,"), InternalError); ASSERT_THROW(checkCode("p<e T=l[<]<>>,"), 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) REGISTER_TEST(TestGarbage)