Fixed debug message #5159
This commit is contained in:
parent
4f61e9783b
commit
04f3caf8e8
|
@ -2578,7 +2578,7 @@ static const Token* skipPointers(const Token* tok)
|
||||||
|
|
||||||
bool Scope::isVariableDeclaration(const Token* tok, const Token*& vartok, const Token*& typetok) const
|
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;
|
return false;
|
||||||
|
|
||||||
const Token* localTypeTok = skipScopeIdentifiers(tok);
|
const Token* localTypeTok = skipScopeIdentifiers(tok);
|
||||||
|
|
|
@ -220,6 +220,7 @@ private:
|
||||||
TEST_CASE(symboldatabase40); // ticket #5153
|
TEST_CASE(symboldatabase40); // ticket #5153
|
||||||
TEST_CASE(symboldatabase41); // ticket #5197 (unknown macro)
|
TEST_CASE(symboldatabase41); // ticket #5197 (unknown macro)
|
||||||
TEST_CASE(symboldatabase42); // only put variables in variable list
|
TEST_CASE(symboldatabase42); // only put variables in variable list
|
||||||
|
TEST_CASE(symboldatabase43); // #4738
|
||||||
|
|
||||||
TEST_CASE(isImplicitlyVirtual);
|
TEST_CASE(isImplicitlyVirtual);
|
||||||
|
|
||||||
|
@ -1863,6 +1864,13 @@ private:
|
||||||
ASSERT_EQUALS(0U, fscope ? fscope->varlist.size() : ~0U); // "x" is not a variable
|
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() {
|
void isImplicitlyVirtual() {
|
||||||
{
|
{
|
||||||
GET_SYMBOL_DB("class Base {\n"
|
GET_SYMBOL_DB("class Base {\n"
|
||||||
|
|
Loading…
Reference in New Issue