-
- Downloads
c++: designated init and aggregate members [PR103337]
Our C++20 designated initializer handling was broken with members of class type; we would find the relevant member and then try to find a member of the member with the same name. Or we would sometimes ignore the designator entirely. The former problem is fixed by the change to reshape_init_class, the latter by the change to reshape_init_r. PR c++/103337 PR c++/102740 PR c++/103299 PR c++/102538 gcc/cp/ChangeLog: * decl.cc (reshape_init_class): Avoid looking for designator after we found it. (reshape_init_r): Keep looking for designator. gcc/testsuite/ChangeLog: * g++.dg/ext/flexary3.C: Remove one error. * g++.dg/parse/pr43765.C: Likewise. * g++.dg/cpp2a/desig22.C: New test. * g++.dg/cpp2a/desig23.C: New test. * g++.dg/cpp2a/desig24.C: New test. * g++.dg/cpp2a/desig25.C: New test.
Showing
- gcc/cp/decl.cc 42 additions, 5 deletionsgcc/cp/decl.cc
- gcc/testsuite/g++.dg/cpp2a/desig22.C 11 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/desig22.C
- gcc/testsuite/g++.dg/cpp2a/desig23.C 20 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/desig23.C
- gcc/testsuite/g++.dg/cpp2a/desig24.C 11 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/desig24.C
- gcc/testsuite/g++.dg/cpp2a/desig25.C 13 additions, 0 deletionsgcc/testsuite/g++.dg/cpp2a/desig25.C
- gcc/testsuite/g++.dg/ext/flexary3.C 1 addition, 1 deletiongcc/testsuite/g++.dg/ext/flexary3.C
- gcc/testsuite/g++.dg/parse/pr43765.C 3 additions, 3 deletionsgcc/testsuite/g++.dg/parse/pr43765.C
Loading
Please register or sign in to comment