Fixed debug message #5159

This commit is contained in:
PKEuS 2014-05-25 12:19:19 +02:00
parent 4f61e9783b
commit 04f3caf8e8
2 changed files with 9 additions and 1 deletions

View File

@ -2578,7 +2578,7 @@ static const Token* skipPointers(const Token* tok)
bool Scope::isVariableDeclaration(const Token* tok, const Token*& vartok, const Token*& typetok) const
{
if (tok && tok->str() == "throw" && check->_tokenizer->isCPP())
if (tok && (tok->str() == "throw" || tok->str() == "new") && check->_tokenizer->isCPP())
return false;
const Token* localTypeTok = skipScopeIdentifiers(tok);

View File

@ -220,6 +220,7 @@ private:
TEST_CASE(symboldatabase40); // ticket #5153
TEST_CASE(symboldatabase41); // ticket #5197 (unknown macro)
TEST_CASE(symboldatabase42); // only put variables in variable list
TEST_CASE(symboldatabase43); // #4738
TEST_CASE(isImplicitlyVirtual);
@ -1863,6 +1864,13 @@ private:
ASSERT_EQUALS(0U, fscope ? fscope->varlist.size() : ~0U); // "x" is not a variable
}
void symboldatabase43() { // ticket #4738
check("void f() {\n"
" new int;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void isImplicitlyVirtual() {
{
GET_SYMBOL_DB("class Base {\n"