Add regression tests for #678,#6834 - crashes on garbage code

This commit is contained in:
Alexander Mai 2015-09-05 08:38:50 +02:00
parent d0ab00b100
commit 890343dad0
1 changed files with 8 additions and 0 deletions

View File

@ -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"