[clang] [clang][C23] Support N3029 Improved Normal Enumerations (PR #103917)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 5 05:16:22 PDT 2024
================
@@ -6194,9 +6195,12 @@ def err_misplaced_ivar : Error<
def warn_ivars_in_interface : Warning<
"declaration of instance variables in the interface is deprecated">,
InGroup<DiagGroup<"objc-interface-ivars">>, DefaultIgnore;
-def ext_enum_value_not_int : Extension<
- "ISO C restricts enumerator values to range of 'int' (%0 is too "
- "%select{small|large}1)">;
+def ext_c23_enum_value_not_int : Extension<
+ "enumerator values exceeding range of 'int' are a C23 extension (%0 is too "
+ "%select{small|large}1)">, InGroup<C23>;
+def warn_c17_compat_enum_value_not_int : Warning<
+ "enumerator values exceeding range of 'int' are incompatible with C standards before C23 (%0 is too "
+ "%select{small|large}1)">, DefaultIgnore, InGroup<CPre23Compat>;
----------------
AaronBallman wrote:
We could add another `%select` in here:
```
def ext_c23_enum_value_not_int : Extension<
"%select{|incremented }0enumerator value which exceeds the range of 'int' is a C23 extension (%1 is too "
"%select{small|large}2)">, InGroup<C23>;
```
WDYT?
https://github.com/llvm/llvm-project/pull/103917
More information about the cfe-commits
mailing list