Skip to content

Commit cbb40d4

Browse files
Update checkother.cpp
1 parent 330d3e2 commit cbb40d4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/checkother.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ static bool isConstStatement(const Token *tok, const Library& library, bool isNe
21642164
return isConstStatement(tok->astOperand1(), library) && isConstStatement(tok->astOperand2(), library);
21652165
if (Token::Match(tok, "!|~|%cop%") && (tok->astOperand1() || tok->astOperand2()))
21662166
return true;
2167-
if (Token::Match(tok->previous(), "sizeof|alignof|noexcept|typeid ("))
2167+
if (Token::Match(tok->previous(), "sizeof|alignof|noexcept|typeid (") && tok->previous()->isKeyword())
21682168
return true;
21692169
if (isCPPCast(tok)) {
21702170
if (Token::simpleMatch(tok->astOperand1(), "dynamic_cast") && Token::simpleMatch(tok->astOperand1()->linkAt(1)->previous(), "& >"))

0 commit comments

Comments
 (0)