[clang] [Clang] add wraps and no_wraps attributes (PR #115094)

Justin Stitt via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 12 15:58:51 PST 2024


================
@@ -6664,6 +6664,13 @@ def err_builtin_counted_by_ref_invalid_lhs_use : Error<
 def err_builtin_counted_by_ref_has_side_effects : Error<
   "'__builtin_counted_by_ref' argument cannot have side-effects">;
 
+def warn_wraps_attr_var_decl_type_not_integer : Warning<
+  "using attribute '%select{wraps|no_wraps}0' with non-integer type '%1' has no function and is potentially misleading">,
+  InGroup<UselessWrapsAttr>;
----------------
JustinStitt wrote:

since this is now an error ([3de3561](https://github.com/llvm/llvm-project/pull/115094/commits/3de3561f6c6e4e73ae1f5cda3a27a6aff5bf9904)) we can be a bit more assertive with the language. I went with:

`cannot use attribute 'wraps' with non-integer type 'float'` which is an error when parsing.

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


More information about the cfe-commits mailing list