https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77295
--- Comment #2 from Avi Kivity <a...@cloudius-systems.com> --- Typically, the code is a template: template <typename T, typename U> struct discriminated_union { unsigned which; union { T v1; U v2; }; }; If either T or U have non-trivial copy/move constructors, then you can't copy/move the union; you have to copy/move a member. I guess a template specialization for the case where both are PODs can be used as a work-around.