@@ -2869,11 +2869,9 @@ static void valueFlowLifetimeClassConstructor(Token* tok,
28692869 args,
28702870 " Passed to constructor of '" + t->name () + " '." ,
28712871 ValueFlow::Value::LifetimeKind::SubObject,
2872- [&](LifetimeStore &ls)
2873- {
2872+ [&](LifetimeStore &ls) {
28742873 // Skip static variable
2875- it = std::find_if (it, scope->varlist .cend (), [&](const Variable &var)
2876- {
2874+ it = std::find_if (it, scope->varlist .cend (), [&](const Variable &var) {
28772875 return !var.isStatic () && (!hasDesignatedInitializers || var.name () == ls.argtok ->astOperand1 ()->astOperand1 ()->str ());
28782876 });
28792877 if (it == scope->varlist .cend ())
@@ -2883,12 +2881,10 @@ static void valueFlowLifetimeClassConstructor(Token* tok,
28832881 const Variable &var = *it;
28842882 if (var.valueType () && var.valueType ()->container && var.valueType ()->container ->stdStringLike && !var.valueType ()->container ->view )
28852883 return ; // TODO: check in isLifetimeBorrowed()?
2886- if (var.isReference () || var.isRValueReference ())
2887- {
2884+ if (var.isReference () || var.isRValueReference ()) {
28882885 ls.byRef (tok, tokenlist, errorLogger, settings);
28892886 }
2890- else if (ValueFlow::isLifetimeBorrowed (ls.argtok , settings))
2891- {
2887+ else if (ValueFlow::isLifetimeBorrowed (ls.argtok , settings)) {
28922888 ls.byVal (tok, tokenlist, errorLogger, settings);
28932889 }
28942890 if (hasDesignatedInitializers)
0 commit comments