https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97690
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- More generally, Clang seems to reliably turn cond ? (2<<N) : 0 into: int(bool(cond)) << N Including when using immediates or constants in places of 2<<N and 0.