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

            Bug ID: 98233
           Summary: A small bug in stl
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 570070308 at qq dot com
  Target Milestone: ---

In the code
```
#include <vector>
#include <stdio.h>
struct A
{
public:
    int a;
    std::vector<A> m;
};
int main()
{
    A x;
    x.m.emplace_back();
    x.a=13;
    x.m[0].a=9;
    printf("%d\n",x.m[0].a);
    x.m[0]=x;
    printf("%d\n",x.m[0].m[0].a);
    return 0;
}
```
expect to output 9 and 9.
But the result is 9 and 13.

Reply via email to