From de7096e3009f067790de5b51c731a83baa682579 Mon Sep 17 00:00:00 2001 From: chrchr-github <78114321+chrchr-github@users.noreply.github.com> Date: Sun, 30 Jul 2023 01:21:55 +0200 Subject: [PATCH] Update valueflow.cpp --- lib/valueflow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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,