Skip to content

Commit fa00e40

Browse files
committed
astutils.cpp: added more bailouts in isMutableExpression() [skip ci]
1 parent 31b8e7e commit fa00e40

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/astutils.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,7 @@ bool isMutableExpression(const Token* tok)
24602460
return false;
24612461
if (tok->isLiteral() || tok->isKeyword() || tok->isStandardType() || tok->isEnumerator())
24622462
return false;
2463-
if (Token::Match(tok, ",|;|:|]|)|}"))
2463+
if (Token::Match(tok, ",|;|:|]|)|}|::"))
24642464
return false;
24652465
if (Token::simpleMatch(tok, "[ ]"))
24662466
return false;
@@ -2847,6 +2847,8 @@ static std::function<R()> memoize(F f)
28472847
};
28482848
}
28492849

2850+
#include <iostream>
2851+
28502852
template<class F,
28512853
REQUIRES("F must be a function that returns a Token class",
28522854
std::is_convertible<decltype(std::declval<F>()()), const Token*> )>
@@ -2880,7 +2882,10 @@ static bool isExpressionChangedAt(const F& getExprTok,
28802882
if (!expr)
28812883
aliased = true;
28822884
if (!aliased)
2885+
{
2886+
std::cout << tok->str() << " " << tok->exprId() << " " << exprid << " " << indirect << std::endl;
28832887
aliased = isAliasOf(tok, expr, &i);
2888+
}
28842889
if (!aliased)
28852890
return false;
28862891
if (isVariableChanged(tok, indirect + i, settings, depth))

0 commit comments

Comments
 (0)