@@ -4783,7 +4783,7 @@ void Tokenizer::setVarId()
47834783#define NOTSTART_C " NOT" , " case" , " default" , " goto" , " not" , " return" , " sizeof" , " typedef"
47844784static const std::unordered_set<std::string> notstart_c = { NOTSTART_C };
47854785static const std::unordered_set<std::string> notstart_cpp = { NOTSTART_C ,
4786- " delete" , " friend" , " new" , " throw" , " using" , " virtual" , " explicit" , " const_cast" , " dynamic_cast" , " reinterpret_cast" , " static_cast" , " template"
4786+ " delete" , " friend" , " new" , " throw" , " using" , " virtual" , " explicit" , " const_cast" , " dynamic_cast" , " reinterpret_cast" , " static_cast" , " template" , " requires "
47874787};
47884788
47894789// Returns the end of the lambda that starts at tok in a constructor initializer list, or nullptr
@@ -4988,8 +4988,8 @@ void Tokenizer::setVarIdPass1()
49884988 (tok->isName () && endsWith (tok->str (), ' :' )))) ||
49894989 (tok->str () == " (" && TokenList::isFunctionHead (tok, " {" ))) {
49904990
4991- // No variable declarations in sizeof
4992- if (Token::simpleMatch (tok->previous (), " sizeof (" )) {
4991+ // No variable declarations in sizeof and static_assert
4992+ if (Token::Match (tok->previous (), " sizeof|static_assert|_Static_assert (" )) {
49934993 continue ;
49944994 }
49954995
@@ -5126,7 +5126,7 @@ void Tokenizer::setVarIdPass1()
51265126
51275127 if (Token::simpleMatch (tok->previous (), " for (" ) && Token::Match (prev2, " %name% [=[({,]" )) {
51285128 for (const Token *tok3 = prev2->next (); tok3 && tok3->str () != " ;" ; tok3 = tok3->next ()) {
5129- if (Token::Match (tok3, " [([]" ))
5129+ if (Token::Match (tok3, " [([{ ]" ))
51305130 tok3 = tok3->link ();
51315131 if (Token::Match (tok3, " , %name% [=[({,;]" ))
51325132 variableMap.addVariable (tok3->strAt (1 ), false );
0 commit comments