https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103295

--- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #7)
> It just doesn't allow assignment through the pointer.

I think that's correct according to [class.union.general] p6:

"When the left operand of an assignment operator involves a member access
expression ([expr.ref]) that nominates a union member, it may begin the
lifetime of that union member, as described below."

`_M_local_buf[0] = 0;` is OK, but `auto p = _M_local_buf; p[0] = 0;` is not.

Reply via email to