[clang] [Clang] Introduce __builtin_is_modifiable_lvalue() (PR #132524)
Kees Cook via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 23:44:35 PDT 2025
kees 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
It is intended to have no side-effects. I followed the same logic used by `__buildin_constant_p`, and the CodeGen tests attempt to validate the lack of side-effects.
I didn't see a difference in your godbolt link? Neither incremented `a`. (Though neither built, so perhaps my tweaking changed the result?)
https://github.com/llvm/llvm-project/pull/132524
More information about the cfe-commits
mailing list