@@ -1187,7 +1187,7 @@ static ParsedType parseVariableDeclaration(const Token* nameTok)
11871187 if (nameTok->strAt (1 ) == " [" ) {
11881188 if (parsed.isReference )
11891189 return ParsedType ();
1190- const Token* rbracket = nameTok->next ()-> link ( );
1190+ const Token* rbracket = nameTok->linkAt ( 1 );
11911191 if (!rbracket || Token::simpleMatch (rbracket->next (), " [" ))
11921192 return ParsedType ();
11931193 if (!decayArrayToPointer (parsed.type ))
@@ -1453,8 +1453,8 @@ namespace {
14531453 // constructor initializer list
14541454 if (Token::simpleMatch (tok, " :" )) {
14551455 tok = tok->next ();
1456- while (Token::Match (tok, " %name% (|{" ) && tok->next ()-> link ( )) {
1457- tok = tok->next ()-> link ( )->next ();
1456+ while (Token::Match (tok, " %name% (|{" ) && tok->linkAt ( 1 )) {
1457+ tok = tok->linkAt ( 1 )->next ();
14581458 if (!Token::simpleMatch (tok, " ," ))
14591459 break ;
14601460 tok = tok->next ();
@@ -1550,16 +1550,16 @@ static ExprType parseOperandType(const DeductionContext& ctx, const Token*& tok,
15501550 const ParsedType castType = parseType (tok->tokAt (2 ), closing);
15511551 if (castType.after != closing || !castType.type .valid )
15521552 return ExprType ();
1553- if (!Token::simpleMatch (closing->next (), " (" ) || !closing->next ()-> link ( ))
1553+ if (!Token::simpleMatch (closing->next (), " (" ) || !closing->linkAt ( 1 ))
15541554 return ExprType ();
1555- tok = closing->next ()-> link ( )->next ();
1555+ tok = closing->linkAt ( 1 )->next ();
15561556 type = castType.type ;
15571557 if (stopsAtPostfix (tok, end))
15581558 return ExprType ();
15591559 } else if (tok->str () == " sizeof" ) {
1560- if (!Token::simpleMatch (tok->next (), " (" ) || !tok->next ()-> link ( ))
1560+ if (!Token::simpleMatch (tok->next (), " (" ) || !tok->linkAt ( 1 ))
15611561 return ExprType ();
1562- tok = tok->next ()-> link ( )->next ();
1562+ tok = tok->linkAt ( 1 )->next ();
15631563 // sizeof yields std::size_t
15641564 const std::size_t size = ctx.settings ->platform .sizeof_size_t ;
15651565 if (size == 0 )
@@ -1586,9 +1586,9 @@ static ExprType parseOperandType(const DeductionContext& ctx, const Token*& tok,
15861586 const ParsedType castType = parseType (tok, tok->next (), true );
15871587 if (castType.after != tok->next () || !castType.type .valid )
15881588 return ExprType ();
1589- if (!tok->next ()-> link ( ))
1589+ if (!tok->linkAt ( 1 ))
15901590 return ExprType ();
1591- tok = tok->next ()-> link ( )->next ();
1591+ tok = tok->linkAt ( 1 )->next ();
15921592 type = castType.type ;
15931593 if (stopsAtPostfix (tok, end))
15941594 return ExprType ();
@@ -1601,9 +1601,9 @@ static ExprType parseOperandType(const DeductionContext& ctx, const Token*& tok,
16011601 const ParsedType returnType = ctx.symbols ->lookupFunctionReturnType (tok->str ());
16021602 if (!returnType.type .valid )
16031603 return ExprType ();
1604- if (!tok->next ()-> link ( ))
1604+ if (!tok->linkAt ( 1 ))
16051605 return ExprType ();
1606- tok = tok->next ()-> link ( )->next ();
1606+ tok = tok->linkAt ( 1 )->next ();
16071607 type = returnType.type ;
16081608 if (stopsAtPostfix (tok, end))
16091609 return ExprType ();
@@ -2011,7 +2011,7 @@ static void recordDeclaration(DeductionSymbolTable& symbols, const Token* tok)
20112011 const ParsedType variable = parseVariableDeclaration (tok);
20122012 if (variable.type .valid ) {
20132013 symbols.addVariable (tok->str (), variable);
2014- } else if (Token::simpleMatch (tok->next (), " (" ) && tok->next ()-> link ( ) && !Token::simpleMatch (tok->previous (), " ::" )) {
2014+ } else if (Token::simpleMatch (tok->next (), " (" ) && tok->linkAt ( 1 ) && !Token::simpleMatch (tok->previous (), " ::" )) {
20152015 // function declaration; a qualified name ("void A::g()") is not
20162016 // visible under its plain name
20172017 if (TokenList::isFunctionHead (tok->next (), " ;{" )) {
0 commit comments