diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 4aed64717b0..c8b928915c1 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -4259,7 +4259,7 @@ struct LifetimeStore { } }; -static bool isOwningVariables(const std::list& vars, const std::vector& args, int depth = 10) +static bool hasBorrowingVariables(const std::list& vars, const std::vector& args, int depth = 10) { if (depth < 0) return false; @@ -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,