zygoloid wrote:

> Should `foo` in the following code return 4 when `-fstrict-flex-arrays` is 2 
> or 3 (but not when it's 0 or 1) only when the target is `-std=c++23` or 
> newer? Or should it return 4 for older standards too?

We evaluate the operand of `__builtin_object_size` in `EM_IgnoreSideEffects` 
mode, which is documented as:

> ```c++
> /// Evaluate in any way we know how. Don't worry about side-effects that
> /// can't be modeled.
> ```

If that mode doesn't already permit using unknown pointers and references in 
all language modes, then we should change it so that it does. 
`__builtin_object_size` is best-effort, but we should produce a constant value 
for it that's not the `-1` or `0` fallback value whenever we're able to do so.

https://github.com/llvm/llvm-project/pull/95474
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to