File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1255,22 +1255,24 @@ static void tryConsumeLambdaSpecifierToken(Parser &P,
12551255 DeclEndLoc = SpecifierLoc;
12561256 };
12571257
1258- while (true ) {
1258+ // Process lambda specifiers until an invalid token is found
1259+ while (P.getCurToken ().isOneOf (tok::kw_mutable, tok::kw_static,
1260+ tok::kw_constexpr, tok::kw_consteval)) {
12591261 switch (P.getCurToken ().getKind ()) {
12601262 case tok::kw_mutable:
1261- ConsumeLocation (MutableLoc, 0 );
1263+ ConsumeLocation (MutableLoc, 0 );
12621264 break ;
12631265 case tok::kw_static:
1264- ConsumeLocation (StaticLoc, 1 );
1266+ ConsumeLocation (StaticLoc, 1 );
12651267 break ;
12661268 case tok::kw_constexpr:
1267- ConsumeLocation (ConstexprLoc, 2 );
1269+ ConsumeLocation (ConstexprLoc, 2 );
12681270 break ;
12691271 case tok::kw_consteval:
12701272 ConsumeLocation (ConstevalLoc, 3 );
12711273 break ;
12721274 default :
1273- return ;
1275+ llvm_unreachable ( " Unexpected token in lambda specifier parsing " ) ;
12741276 }
12751277 }
12761278}
You can’t perform that action at this time.
0 commit comments