Added test case from #3533 (segmentation fault of cppcheck).
This commit is contained in:
parent
86a5a9a7bf
commit
f8578a380a
|
@ -365,6 +365,7 @@ private:
|
|||
TEST_CASE(simplifyStructDecl2); // ticket #2579
|
||||
TEST_CASE(simplifyStructDecl3);
|
||||
TEST_CASE(simplifyStructDecl4);
|
||||
TEST_CASE(simplifyStructDecl5); // ticket #3533 (segmentation fault)
|
||||
|
||||
// register int var; => int var;
|
||||
// inline int foo() {} => int foo() {}
|
||||
|
@ -7375,7 +7376,6 @@ private:
|
|||
}
|
||||
|
||||
void simplifyStructDecl4() {
|
||||
{
|
||||
const char code[] = "class ABC {\n"
|
||||
" void foo() {\n"
|
||||
" union {\n"
|
||||
|
@ -7402,6 +7402,16 @@ private:
|
|||
"} ; ABC abc ;";
|
||||
ASSERT_EQUALS(expected, tok(code, false));
|
||||
}
|
||||
|
||||
void simplifyStructDecl5() {
|
||||
const char code[] = "<class T>\n"
|
||||
"{\n"
|
||||
" struct {\n"
|
||||
" typename D4:typename Base<T*>\n"
|
||||
" };\n"
|
||||
"};\n";
|
||||
//don't crash
|
||||
tok(code, false);
|
||||
}
|
||||
|
||||
void removeUnwantedKeywords() {
|
||||
|
|
Loading…
Reference in New Issue