fix #2577 (segmentation fault of cppcheck)

This commit is contained in:
Robert Reif 2011-02-12 15:35:48 -05:00
parent de75bdfed5
commit 2aefa5deb5
2 changed files with 12 additions and 1 deletions

View File

@ -227,7 +227,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
// out of line function
if (Token::Match(end, ") const| ;") ||
Token::Match(end, ") const| = %any% ;"))
Token::Match(end, ") const| = %any%"))
{
// find the function implementation later
tok = end->next();

View File

@ -191,6 +191,7 @@ private:
TEST_CASE(symboldatabase10); // ticket #2537
TEST_CASE(symboldatabase11); // ticket #2539
TEST_CASE(symboldatabase12); // ticket #2547
TEST_CASE(symboldatabase13); // ticket #2577
}
// Check the operator Equal
@ -5528,6 +5529,16 @@ private:
ASSERT_EQUALS("", errout.str());
}
void symboldatabase13()
{
// ticket #2577 - segmentation fault
checkConst("class foo {\n"
" void bar2 () = A::f;\n"
"};\n");
ASSERT_EQUALS("", errout.str());
}
};
REGISTER_TEST(TestClass)