[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 22 04:06:45 PDT 2025


tbaederr wrote:

> > It looks like this is similar to `__builtin_constant_p` - what is the proposed behavior wrt. side effects in the evaluated expression? gcc and clang disagree about this a lot currently: https://godbolt.org/z/rbneznT9z
> 
> IIUC this intrinsic shouldn't be similar to `__builtin_constant_p`. It's just investigating properties of the type and value category of an expression (like `std::is_lvalue_reference_v<decltype((expr))>` in C++ but with more magics).

That's fine with me. If the argument isn't evaluated anyway, we don't need the `SpeculativeEvaluationRAII` and `IgnoreSideEffectsRAII` either.

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


More information about the cfe-commits mailing list