@@ -998,8 +998,8 @@ void Variable::evaluate()
998998 setFlag (fIsReference , true ); // Set also fIsReference
999999 }
10001000
1001- if (tok->str () == " <" )
1002- tok-> findClosingBracket (tok );
1001+ if (tok->str () == " <" && tok-> link () )
1002+ tok = tok-> link ( );
10031003 else
10041004 tok = tok->next ();
10051005 }
@@ -1373,7 +1373,7 @@ const Token *Type::initBaseInfo(const Token *tok, const Token *tok1)
13731373 while (tok2 && tok2->str () != " {" ) {
13741374 // skip unsupported templates
13751375 if (tok2->str () == " <" )
1376- tok2-> findClosingBracket (tok2 );
1376+ tok2 = tok2-> link ( );
13771377
13781378 // check for base classes
13791379 else if (Token::Match (tok2, " :|," )) {
@@ -1828,8 +1828,8 @@ void Function::addArguments(const SymbolDatabase *symbolDatabase, const Scope *s
18281828 while (tok->next ()->str () == " [" )
18291829 tok = tok->next ()->link ();
18301830 } else if (tok->str () == " <" ) {
1831- bool success = tok->findClosingBracket (tok );
1832- if (!tok || !success ) // something is wrong so just bail out
1831+ tok = tok->link ( );
1832+ if (!tok) // something is wrong so just bail out
18331833 return ;
18341834 }
18351835
@@ -2297,9 +2297,8 @@ bool Scope::isVariableDeclaration(const Token* tok, const Token*& vartok, const
22972297 const Token* localVarTok = NULL ;
22982298
22992299 if (Token::Match (localTypeTok, " %type% <" )) {
2300- const Token* closeTok = NULL ;
2301- bool found = localTypeTok->next ()->findClosingBracket (closeTok);
2302- if (found) {
2300+ const Token* closeTok = localTypeTok->next ()->link ();
2301+ if (closeTok) {
23032302 localVarTok = skipPointers (closeTok->next ());
23042303
23052304 if (Token::Match (localVarTok, " :: %type% %var% ;|=|(" )) {
0 commit comments