[clang] [Clang][NFC] Update diagnostic handling for C2y compatibility in parser (PR #209920)

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 16 08:25:10 PDT 2026


================
@@ -169,12 +169,7 @@ def ext_c2y_generic_with_type_arg : Extension<
 def warn_c2y_compat_generic_with_type_arg : Warning<
   "passing a type argument as the first operand to '_Generic' is incompatible "
   "with C standards before C2y">, InGroup<CPre2yCompat>, DefaultIgnore;
-def warn_c2y_compat_decl_statement : Warning<
-  "'%select{if|switch}0' declaration statements are incompatible with "
-  "C standards before C2y">, DefaultIgnore, InGroup<CPre2yCompat>;
-def ext_c2y_decl_statement : Extension<
-  "'%select{if|switch}0' declaration statements are a C2y extension">,
-  InGroup<C2y>;
+defm decl_statement : C2yCompat<"'%select{if|switch}0' declaration statements are">;
----------------
Sirraide wrote:

Please move this to the top of the file so all compatibility diagnostics are in one place, just above `enum_fixed_underlying_type` (see also `DiagnosticSemaKinds.td` for more examples of how I like to group these)

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


More information about the cfe-commits mailing list