[clang] [C23] Fix typeof handling in enum declarations (PR #146394)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 2 11:57:13 PDT 2025


================
@@ -1000,8 +1001,10 @@ ExprResult Parser::ParseCastExpression(CastParseKind ParseKind,
     Token Replacement;
     CastExpressionIdValidator Validator(
         /*Next=*/Tok,
-        /*AllowTypes=*/isTypeCast != TypeCastState::NotTypeCast,
-        /*AllowNonTypes=*/isTypeCast != TypeCastState::IsTypeCast);
+        /*AllowTypes=*/CorrectionBehavior !=
+            TypoCorrectionTypeBehavior::AllowNonTypes,
+        /*AllowNonTypes=*/CorrectionBehavior !=
+            TypoCorrectionTypeBehavior::AllowTypes);
     Validator.IsAddressOfOperand = isAddressOfOperand;
----------------
Sirraide wrote:

I feel like at this point the `CastExpressionIdValidator` should just store the `TypoCorrectionTypeBehavior` instead of splitting it into two flags—or am I missing something here?

https://github.com/llvm/llvm-project/pull/146394


More information about the cfe-commits mailing list