ahatanak wrote:

> In any context where the standard requires constant evaluation, we have to 
> return false, probably. (This corresponds, roughly, to 
> Info.InConstantContext. I don't think we have a bit that precisely 
> corresponds, though.)

For Type=3, conditionally returning false when `InConstantContext` is set 
triggered undesirable warnings (e.g., clang emitted a division-by-zero warning 
for function `f3` in `constant-expression-p2280r4.cpp`), so I removed that 
check. As a result, CodeGen now emits a lower bound of 0 in cases where it 
could otherwise emit a tighter bound using the conservative lower bound (see 
`clang/test/CodeGenCXX/builtin-object-size.cpp`).

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

Reply via email to