File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1735,7 +1735,8 @@ void SymbolDatabase::createSymbolDatabaseExprIds()
17351735 }
17361736 for (Token* tok = const_cast <Token*>(scope->bodyStart ); tok != scope->bodyEnd ; tok = tok->next ()) {
17371737 if (tok->varId () == 0 && tok->exprId () > 0 && tok->astParent () && !tok->astOperand1 () && !tok->astOperand2 ()) {
1738- if (Token::Match (tok->astParent (), " %name%|.|::" ))
1738+ if (tok->isNumber () || tok->isKeyword () || Token::Match (tok->astParent (), " .|::" ) ||
1739+ (Token::simpleMatch (tok->astParent (), " (" ) && precedes (tok, tok->astParent ())))
17391740 tok->exprId (0 );
17401741 }
17411742 }
Original file line number Diff line number Diff line change @@ -3898,8 +3898,8 @@ class TestVarID : public TestFixture {
38983898 " while (b && y > 0) {}\n "
38993899 " }\n " ;
39003900 const char expected[] = " 1: void f ( bool b , int y ) {\n "
3901- " 2: if ( b@1 &&@5 y@2 >@4 0@3 ) { }\n "
3902- " 3: while ( b@1 &&@5 y@2 >@4 0@3 ) { }\n "
3901+ " 2: if ( b@1 &&@5 y@2 >@4 0 ) { }\n "
3902+ " 3: while ( b@1 &&@5 y@2 >@4 0 ) { }\n "
39033903 " 4: }\n " ;
39043904 ASSERT_EQUALS (expected, tokenizeExpr (code));
39053905 }
You can’t perform that action at this time.
0 commit comments