Fixed #2547 (segmentation fault of cppcheck)
This commit is contained in:
parent
c078d804b9
commit
c592ccd35d
|
@ -213,7 +213,7 @@ SymbolDatabase::SymbolDatabase(const Tokenizer *tokenizer, const Settings *setti
|
|||
function.isConst = true;
|
||||
|
||||
// pure virtual function
|
||||
if (Token::Match(end, ") const| = 0 ;"))
|
||||
if (Token::Match(end, ") const| = %any% ;"))
|
||||
function.isPure = true;
|
||||
|
||||
// count the number of constructors
|
||||
|
@ -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| = 0 ;"))
|
||||
Token::Match(end, ") const| = %any% ;"))
|
||||
{
|
||||
// find the function implementation later
|
||||
tok = end->next();
|
||||
|
|
|
@ -190,6 +190,7 @@ private:
|
|||
TEST_CASE(symboldatabase9); // ticket #2525
|
||||
TEST_CASE(symboldatabase10); // ticket #2537
|
||||
TEST_CASE(symboldatabase11); // ticket #2539
|
||||
TEST_CASE(symboldatabase12); // ticket #2547
|
||||
}
|
||||
|
||||
// Check the operator Equal
|
||||
|
@ -5517,6 +5518,16 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void symboldatabase12()
|
||||
{
|
||||
// ticket #2547 - segmentation fault
|
||||
checkConst("class foo {\n"
|
||||
" void bar2 () = __null;\n"
|
||||
"};\n");
|
||||
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestClass)
|
||||
|
|
Loading…
Reference in New Issue