File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2003,20 +2003,17 @@ static bool isc_strConstructor(const Token* tok)
20032003{
20042004 if (!tok->valueType () || !Token::Match (tok, " %var% (|{" ))
20052005 return false ;
2006-
2007- const Token* callTok = tok->tokAt (1 )->astOperand2 ();
2008- while (Token::simpleMatch (callTok, " +" ) && callTok->isBinaryOp ()) {
2009- if (callTok->astOperand1 ()->str () == " +" ) {
2010- callTok = callTok->astOperand1 ();
2011- continue ;
2006+ bool result = false ;
2007+ visitAstNodes (tok->tokAt (1 )->astOperand2 (), [&](const Token* tok2) {
2008+ if (Token::simpleMatch (tok2, " +" ))
2009+ return ChildrenToVisit::op1_and_op2;
2010+ if (isc_strCall (tok2, tok->valueType ()->container )) {
2011+ result = true ;
2012+ return ChildrenToVisit::done;
20122013 }
2013- if (callTok->astOperand1 ()->str () == " (" )
2014- callTok = callTok->astOperand1 ();
2015- else if (callTok->astOperand2 ()->str () == " (" )
2016- callTok = callTok->astOperand2 ();
2017- break ;
2018- }
2019- return isc_strCall (callTok, tok->valueType ()->container );
2014+ return ChildrenToVisit::none;
2015+ });
2016+ return result;
20202017}
20212018
20222019namespace {
You can’t perform that action at this time.
0 commit comments