https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114285
--- Comment #8 from Antoni <bouanto at zoho dot com> --- Created attachment 57726 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57726&action=edit Reproducer using union I tried switching to a union and I still get the same error. A union is used by std::optional, so I would assume that this should work. Or is copying uninitialized memory via a union also UB?