Fix issue 9001: FP: Found suspicious operator ',' [constStatement]
This commit is contained in:
parent
9d75b718d3
commit
032020c40d
|
@ -1374,7 +1374,7 @@ static bool isConstStatement(const Token *tok)
|
|||
if (Token::Match(tok, "%var%"))
|
||||
return true;
|
||||
if (Token::Match(tok, "*|&|&&") &&
|
||||
(Token::Match(tok->previous(), "::|.") || isVarDeclOp(tok)))
|
||||
(Token::Match(tok->previous(), "::|.|const|volatile|restrict") || isVarDeclOp(tok)))
|
||||
return false;
|
||||
if (Token::Match(tok, "<<|>>") && !astIsIntegral(tok, false))
|
||||
return false;
|
||||
|
|
|
@ -356,6 +356,15 @@ private:
|
|||
|
||||
check("void f() { std::vector<b> &&c; }", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f() { char * const * a, * const * b; }", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f() { char * const * a = 0, * volatile restrict * b; }", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void f() { char * const * a = 0, * volatile const * b; }", true);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue