https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104182
Bug ID: 104182 Summary: [12 Regression] Wrong code since r12-6329-g4f6bc28fc7dd86bd Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- Originally reported here: https://gitlab.kitware.com/cmake/cmake/-/issues/23126#note_1111696 for the following we emit a wrong code: $ cat cmake-repro.C #include <iostream> #include <string> #include <vector> struct S { int A; std::string B; }; struct V { std::vector<S> v; }; static const V v{ { { { 1, "2" } } } }; int main() { if (v.v[0].A != 1 || v.v[0].B[0] != '2') __builtin_abort(); return 0; } $ g++ cmake-repro.C && ./a.out Aborted (core dumped)