Skip to content

Commit

Permalink
Update valueflow.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Jan 16, 2025
1 parent 0f52fea commit 08f8d60
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1792,11 +1792,12 @@ static bool isDifferentType(const Token* src, const Token* dst)
} else {
std::pair<const Token*, const Token*> decl = Token::typeDecl(src);
std::pair<const Token*, const Token*> parentdecl = Token::typeDecl(dst);
if (isNotEqual(decl, parentdecl))
const bool isCpp = (src && src->isCpp()) || (dst && dst->isCpp());
if (isNotEqual(decl, parentdecl) && !(isCpp && (Token::simpleMatch(decl.first, "auto") || Token::simpleMatch(parentdecl.first, "auto"))))
return true;
if (isNotEqual(decl, dst->valueType(), dst->isCpp()))
if (isNotEqual(decl, dst->valueType(), isCpp))
return true;
if (isNotEqual(parentdecl, src->valueType(), src->isCpp()))
if (isNotEqual(parentdecl, src->valueType(), isCpp))
return true;
}
return false;
Expand Down

0 comments on commit 08f8d60

Please sign in to comment.