File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3341,12 +3341,14 @@ bool Tokenizer::simplifyUsing()
33413341 }
33423342 } else if (fpArgList && fpQual && Token::Match (tok1->next (), " %name%" )) {
33433343 // function pointer
3344+ const bool isFuncDecl = Token::simpleMatch (tok1->tokAt (2 ), " (" );
33443345 TokenList::copyTokens (tok1->next (), fpArgList, usingEnd->previous ());
33453346 Token* const copyEnd = TokenList::copyTokens (tok1, start, fpQual->link ()->previous ());
33463347 Token* leftPar = copyEnd->previous ();
33473348 while (leftPar->str () != " (" )
33483349 leftPar = leftPar->previous ();
3349- Token* const rightPar = copyEnd->next ()->insertToken (" )" );
3350+ Token* const insertTok = isFuncDecl ? copyEnd->linkAt (2 ) : copyEnd->next ();
3351+ Token* const rightPar = insertTok->insertToken (" )" );
33503352 Token::createMutualLinks (leftPar, rightPar);
33513353 tok1->deleteThis ();
33523354 substitute = true ;
You can’t perform that action at this time.
0 commit comments