[clang] [Clang][C2y] Add support for if declarations (N3356 paper) (PR #198244)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 08:12:27 PDT 2026


================
@@ -220,6 +226,9 @@ def ext_c2y_case_range : Extension<
   "case ranges are a C2y extension">, InGroup<C2y>;
 def err_c2y_labeled_break_continue : Error<
   "named %select{'break'|'continue'}0 is only supported in C2y">;
+def err_c2y_first_condition_clause_is_not_declaration : Error<
+  "first clause in condition must be a declaration">;
+def err_c2y_multiple_declarations : Error<"multiple declarations are not allowed">;
----------------
AaronBallman wrote:

I don't see anything in the C standard that requires this, and GCC accepts: https://godbolt.org/z/T5M49eEqo

Was there something in the standard or N3356 that I missed?

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


More information about the cfe-commits mailing list