* Fix #10923 FP constStatement with ptr to ptr to ptr * simpleMatch
This commit is contained in:
parent
a143fa37dd
commit
5ed521622f
|
@ -1769,6 +1769,8 @@ static bool isConstStatement(const Token *tok, bool cpp)
|
||||||
return false;
|
return false;
|
||||||
if (Token::Match(tok, "<<|>>") && !astIsIntegral(tok, false))
|
if (Token::Match(tok, "<<|>>") && !astIsIntegral(tok, false))
|
||||||
return false;
|
return false;
|
||||||
|
if (tok->astTop() && Token::simpleMatch(tok->astTop()->astOperand1(), "delete"))
|
||||||
|
return false;
|
||||||
if (Token::Match(tok, "!|~|%cop%") && (tok->astOperand1() || tok->astOperand2()))
|
if (Token::Match(tok, "!|~|%cop%") && (tok->astOperand1() || tok->astOperand2()))
|
||||||
return true;
|
return true;
|
||||||
if (Token::simpleMatch(tok->previous(), "sizeof ("))
|
if (Token::simpleMatch(tok->previous(), "sizeof ("))
|
||||||
|
|
|
@ -4809,6 +4809,11 @@ private:
|
||||||
"}");
|
"}");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
check("void f(const int*** p) {\n" // #10923
|
||||||
|
" delete[] **p;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
check("void *f(char** c) {\n"
|
check("void *f(char** c) {\n"
|
||||||
" bar(**c++);\n"
|
" bar(**c++);\n"
|
||||||
"}");
|
"}");
|
||||||
|
|
Loading…
Reference in New Issue