https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116302
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This is not how you use transparent_union ... For this to work, you should do : ``` opflags_t antiop(opflags_t op) { return (op.v = ~op.v), op; } ``` `transparent union` is ONLY about argument passing and nothing else. This is documented as such too. From https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Common-Type-Attributes.html#index-transparent_005funion-type-attribute : This attribute, attached to a union type definition, indicates that any function parameter having that union type causes calls to that function to be treated in a special way.