[clang] [clang][ExprConst] Add diagnostics for invalid binary arithmetic (PR #118475)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 3 11:01:44 PST 2024


================
@@ -91,11 +91,15 @@ def note_constexpr_pointer_subtraction_zero_size : Note<
   "subtraction of pointers to type %0 of zero size">;
 def note_constexpr_pointer_comparison_unspecified : Note<
   "comparison between '%0' and '%1' has unspecified value">;
+def note_constexpr_pointer_arith_unspecified : Note<
+  "arithmetic involving '%0' and '%1' has unspecified value">;
----------------
zygoloid wrote:

```suggestion
def note_constexpr_pointer_comparison_unspecified : Note<
  "comparison between pointers to unrelated objects '%0' and '%1' has unspecified value">;
def note_constexpr_pointer_arith_unspecified : Note<
  "arithmetic involving pointers to unrelated objects '%0' and '%1' has unspecified value">;
```

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


More information about the cfe-commits mailing list