Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/fwdanalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,8 @@ bool FwdAnalysis::possiblyAliased(const Token *expr, const Token *startToken) co
return true;
if (Token::simpleMatch(expr, ". *"))
return true;
if (expr->str() == "(" && Token::simpleMatch(expr->astOperand1(), "."))
return true;

const bool macro = false;
const bool pure = false;
Expand Down
10 changes: 10 additions & 0 deletions test/cfg/qt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -775,3 +775,13 @@ void unusedVariable_qtContainers() // #10689
QLatin1String ql1s;
}

void unreadVariable_QMapIterator(QMap<QString, QObject*>& m)
{
auto it = m.find("abc"); // #12662
if (it != m.end()) {
// cppcheck-suppress checkLibraryFunction // TODO
Comment thread
chrchr-github marked this conversation as resolved.
delete it.value();
// cppcheck-suppress checkLibraryFunction
it.value() = new QObject();
}
}