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 Jul 29, 2023
1 parent e9f369d commit de7096e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/valueflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4259,7 +4259,7 @@ struct LifetimeStore {
}
};

static bool isOwningVariables(const std::list<Variable>& vars, const std::vector<const Token*>& args, int depth = 10)
static bool hasBorrowingVariables(const std::list<Variable>& vars, const std::vector<const Token*>& args, int depth = 10)
{
if (depth < 0)
return false;
Expand Down Expand Up @@ -4361,7 +4361,7 @@ static void valueFlowLifetimeUserConstructor(Token* tok,
else
ls.byVal(tok, tokenlist, errorLogger, settings);
});
} else if (isOwningVariables(constructor->nestedIn->varlist, args)) {
} else if (hasBorrowingVariables(constructor->nestedIn->varlist, args)) {
LifetimeStore::forEach(args,
"Passed to constructor of '" + name + "'.",
ValueFlow::Value::LifetimeKind::SubObject,
Expand Down

0 comments on commit de7096e

Please sign in to comment.