Skip to content

Commit

Permalink
valueflow.cpp: removed mutable from lifetimeStore::forwardTok
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Apr 2, 2024
1 parent 127d361 commit 589d6f3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4113,7 +4113,7 @@ struct LifetimeStore {
ErrorLogger& errorLogger,
const Settings& settings,
Predicate pred,
SourceLocation loc = SourceLocation::current()) const
SourceLocation loc = SourceLocation::current())
{
if (!argtok)
return false;
Expand Down Expand Up @@ -4153,7 +4153,7 @@ struct LifetimeStore {
TokenList& tokenlist,
ErrorLogger& errorLogger,
const Settings& settings,
SourceLocation loc = SourceLocation::current()) const
SourceLocation loc = SourceLocation::current())
{
return byRef(
tok,
Expand All @@ -4172,7 +4172,7 @@ struct LifetimeStore {
ErrorLogger& errorLogger,
const Settings& settings,
Predicate pred,
SourceLocation loc = SourceLocation::current()) const
SourceLocation loc = SourceLocation::current())
{
if (!argtok)
return false;
Expand Down Expand Up @@ -4248,7 +4248,7 @@ struct LifetimeStore {
TokenList& tokenlist,
ErrorLogger& errorLogger,
const Settings& settings,
SourceLocation loc = SourceLocation::current()) const
SourceLocation loc = SourceLocation::current())
{
return byVal(
tok,
Expand Down Expand Up @@ -4317,8 +4317,8 @@ struct LifetimeStore {

private:
// cppcheck-suppress naming-privateMemberVariable
mutable Token* forwardTok{};
void forwardLifetime(Token* tok, TokenList& tokenlist, ErrorLogger& errorLogger, const Settings& settings) const {
Token* forwardTok{};
void forwardLifetime(Token* tok, TokenList& tokenlist, ErrorLogger& errorLogger, const Settings& settings) {
forwardTok = tok;
valueFlowForwardLifetime(tok, tokenlist, errorLogger, settings);
}
Expand Down Expand Up @@ -4419,7 +4419,7 @@ static void valueFlowLifetimeUserConstructor(Token* tok,
args,
"Passed to constructor of '" + name + "'.",
ValueFlow::Value::LifetimeKind::SubObject,
[&](const LifetimeStore& ls) {
[&](LifetimeStore& ls) {
const Variable* paramVar = argToParam.at(ls.argtok);
if (paramCapture.count(paramVar) == 0)
return;
Expand Down Expand Up @@ -4681,7 +4681,7 @@ static void valueFlowLifetimeClassConstructor(Token* tok,
args,
"Passed to constructor of '" + t->name() + "'.",
ValueFlow::Value::LifetimeKind::SubObject,
[&](const LifetimeStore& ls) {
[&](LifetimeStore& ls) {
// Skip static variable
it = std::find_if(it, scope->varlist.cend(), [](const Variable& var) {
return !var.isStatic();
Expand Down Expand Up @@ -4728,7 +4728,7 @@ static void valueFlowLifetimeConstructor(Token* tok, TokenList& tokenlist, Error
args,
"Passed to initializer list.",
ValueFlow::Value::LifetimeKind::SubObject,
[&](const LifetimeStore& ls) {
[&](LifetimeStore& ls) {
ls.byVal(tok, tokenlist, errorLogger, settings);
});
} else if (vt.container && vt.type == ValueType::CONTAINER) {
Expand All @@ -4754,7 +4754,7 @@ static void valueFlowLifetimeConstructor(Token* tok, TokenList& tokenlist, Error
args,
"Passed to initializer list.",
ValueFlow::Value::LifetimeKind::SubObject,
[&](const LifetimeStore& ls) {
[&](LifetimeStore& ls) {
ls.byVal(tok, tokenlist, errorLogger, settings);
});
}
Expand Down

0 comments on commit 589d6f3

Please sign in to comment.