@@ -365,7 +365,7 @@ const Token *ValueFlow::parseCompareInt(const Token *tok, ValueFlow::Value &true
365365 });
366366}
367367
368- static bool isEscapeScope (const Token* tok, const Settings& settings , bool unknown = false )
368+ static bool isEscapeScope (const Token* tok, const Library& library , bool unknown = false )
369369{
370370 if (!Token::simpleMatch (tok, " {" ))
371371 return false ;
@@ -374,7 +374,7 @@ static bool isEscapeScope(const Token* tok, const Settings& settings, bool unkno
374374 if (termTok && termTok->scope () == tok->scope ())
375375 return true ;
376376 std::string unknownFunction;
377- if (settings. library .isScopeNoReturn (tok->link (), &unknownFunction))
377+ if (library.isScopeNoReturn (tok->link (), &unknownFunction))
378378 return unknownFunction.empty () || unknown;
379379 return false ;
380380}
@@ -3044,7 +3044,7 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger &errorLogger, co
30443044 // Skip if its a free function that doesnt yield an iterator to the container
30453045 if (Token::Match (parent->previous (), " %name% (" ) &&
30463046 !contains ({Library::Container::Yield::START_ITERATOR, Library::Container::Yield::END_ITERATOR},
3047- astFunctionYield (parent->previous (), settings)))
3047+ astFunctionYield (parent->previous (), settings. library )))
30483048 continue ;
30493049
30503050 ValueFlow::Value master;
@@ -3056,7 +3056,7 @@ static void valueFlowLifetime(TokenList &tokenlist, ErrorLogger &errorLogger, co
30563056 master.lifetimeKind = ValueFlow::Value::LifetimeKind::Iterator;
30573057 } else if (astIsIterator (parent) && Token::Match (parent->previous (), " %name% (" ) &&
30583058 contains ({Library::Container::Yield::START_ITERATOR, Library::Container::Yield::END_ITERATOR},
3059- astFunctionYield (parent->previous (), settings))) {
3059+ astFunctionYield (parent->previous (), settings. library ))) {
30603060 master.errorPath .emplace_back (parent, " Iterator to container is created here." );
30613061 master.lifetimeKind = ValueFlow::Value::LifetimeKind::Iterator;
30623062 } else if ((astIsPointer (parent->tokAt (2 )) &&
@@ -3479,7 +3479,7 @@ static void valueFlowConditionExpressions(const TokenList& tokenlist,
34793479 }
34803480
34813481 // Check if the block terminates early
3482- if (isEscapeScope (blockTok, settings)) {
3482+ if (isEscapeScope (blockTok, settings. library )) {
34833483 const Scope* scope2 = scope;
34843484 // If escaping a loop then only use the loop scope
34853485 if (isBreakOrContinueScope (blockTok->link ())) {
@@ -6339,17 +6339,17 @@ static void valueFlowSmartPointer(TokenList &tokenlist, ErrorLogger & errorLogge
63396339 }
63406340}
63416341
6342- static Library::Container::Yield findIteratorYield (Token* tok, const Token*& ftok, const Settings& settings )
6342+ static Library::Container::Yield findIteratorYield (Token* tok, const Token*& ftok, const Library& library )
63436343{
6344- auto yield = astContainerYield (tok, settings. library , &ftok);
6344+ auto yield = astContainerYield (tok, library, &ftok);
63456345 if (ftok)
63466346 return yield;
63476347
63486348 if (!tok->astParent ())
63496349 return yield;
63506350
63516351 // begin/end free functions
6352- return astFunctionYield (tok->astParent ()->previous (), settings , &ftok);
6352+ return astFunctionYield (tok->astParent ()->previous (), library , &ftok);
63536353}
63546354
63556355static void valueFlowIterators (TokenList& tokenlist, const Settings& settings)
@@ -6362,7 +6362,7 @@ static void valueFlowIterators(TokenList& tokenlist, const Settings& settings)
63626362 if (!astIsContainer (tok))
63636363 continue ;
63646364 const Token* ftok = nullptr ;
6365- const Library::Container::Yield yield = findIteratorYield (tok, ftok, settings);
6365+ const Library::Container::Yield yield = findIteratorYield (tok, ftok, settings. library );
63666366 if (!ftok)
63676367 continue ;
63686368 if (yield == Library::Container::Yield::START_ITERATOR) {
0 commit comments