Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed Possibly erroneous expression without side-effects Rider warnings #7011

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
6 changes: 4 additions & 2 deletions lib/importproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1324,8 +1324,10 @@ bool ImportProject::importCppcheckGuiProject(std::istream &istr, Settings *setti
const auto& addons = readXmlStringList(node, emptyString, CppcheckXml::AddonElementName, nullptr);
temp.addons.insert(addons.cbegin(), addons.cend());
}
else if (strcmp(name, CppcheckXml::TagsElementName) == 0)
node->Attribute(CppcheckXml::TagElementName); // FIXME: Write some warning
else if (strcmp(name, CppcheckXml::TagsElementName) == 0) {
// TODO
//node->Attribute(CppcheckXml::TagElementName); // FIXME: Write some warning
}
else if (strcmp(name, CppcheckXml::ToolsElementName) == 0) {
const std::list<std::string> toolList = readXmlStringList(node, emptyString, CppcheckXml::ToolElementName, nullptr);
for (const std::string &toolName : toolList) {
Expand Down
3 changes: 2 additions & 1 deletion lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2072,12 +2072,13 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger &errorLogger, co
tok2, "Lambda captures variable by reference here.", ValueFlow::Value::LifetimeKind::Lambda};
ls.forward = false;
update |= ls.byRef(tok, tokenlist, errorLogger, settings, pred);
// TODO: call pred(tok2)?
} else if (c == LifetimeCapture::ByValue) {
LifetimeStore ls{
tok2, "Lambda captures variable by value here.", ValueFlow::Value::LifetimeKind::Lambda};
ls.forward = false;
update |= ls.byVal(tok, tokenlist, errorLogger, settings, pred);
pred(tok2);
(void)pred(tok2);
}
};

Expand Down