https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122772
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
But then what about
int foo () { return 0; }
int bar () { return 1; }
struct S { int y : 4; };
S &baz () { static S s; return s; }
struct T { int x; int z : 4; };
T &qux () { static T s; return s; }
void
plugh (bool x)
{
(x ? (baz ().y = foo ()) : (qux ().z = foo ())) += bar ();
}
?
While I have some idea how to handle stabilization of bitfields (and
DECL_PACKED component refs), maybe even COND_EXPRs where both branches have
bit-field COMPONENT_REFs accessing (possibly different but better the same)
bit-field in both,
if both have different types, I'm out of ideas.
Note, clang on the above says:
error: cannot compile this conditional operator yet
Perhaps it could just take address of whatever the object contains the bitfield
(or DECL_PACKED) and cast to (void *) and then outside of the SAVE_EXPR using
SAVE_EXPR condition try to repeat to what it should be cast again, but will
that be constexpr compatible?