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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't think this is a bug.

The assignment of A does a memberwise copy, which means first it assigns the
A::a member, then it assigns the A::m member. That means x.m[0] = x is
equivalent to:

x.m[0].a = x.a;
x.m[0].m = x.m;

Initially x.m[0] is {9,{}}.

After the first member gets assigned it is {13,{}}.

After the second member gets assigned it is {13,{13,{}}}.

Reply via email to