[clang] [Clang] Diagnose invalid object size kinds during constant evaluation (PR #230979)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 02:21:13 PDT 2026


================
@@ -29,6 +29,8 @@ def note_constexpr_invalid_downcast : Note<
   "cannot cast object of dynamic type %0 to type %1">;
 def note_constexpr_overflow : Note<
   "value %0 is outside the range of representable values of type %1">;
+def note_constexpr_builtin_arg_out_of_range : Note<
+  "argument value %0 is outside the valid range [%1, %2]">;
----------------
keepyixiao wrote:

Thanks for the comment. Are you suggesting that I make this diagnostic
object-size-specific and hardcode the valid range [0, 3], instead of passing
the lower and upper bounds as arguments?

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


More information about the cfe-commits mailing list