================
@@ -115,6 +115,12 @@ void constant_expression(int x) {
   _Static_assert(!__builtin_is_aligned(256, 512ULL), "");
   _Static_assert(__builtin_align_up(33, 32) == 64, "");
   _Static_assert(__builtin_align_down(33, 32) == 32, "");
+  _Static_assert(__builtin_is_aligned((void *)0, 1), ""); // expected-warning 
{{checking whether a value is aligned to 1 byte is always true}}
----------------
AaronBallman wrote:

+1, this comment was from when I was thinking we should diagnose all of these 
cases as being effectively UB per the documentation suggesting `uintptr_t` 
being the way to handle integers as pointers consistently. But with the 
recommendation from Eli to just support this case, I think the new constant 
expression interpreter behavior is what should change for this case.

https://github.com/llvm/llvm-project/pull/224549
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to