https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109871
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:efdcb731bbd6e20552fe878d54e59dc06af02334 commit r13-7357-gefdcb731bbd6e20552fe878d54e59dc06af02334 Author: Patrick Palka <ppa...@redhat.com> Date: Tue May 16 12:39:16 2023 -0400 c++: desig init in presence of list ctor [PR109871] add_list_candidates has logic to reject designated initialization of a non-aggregate type, but this is inadvertently being suppressed if the type has a list constructor due to the order of case analysis, which in the below testcase leads to us incorrectly treating the initializer list as if it's non-designated. This patch fixes this by making us check for invalid designated initialization sooner. PR c++/109871 gcc/cp/ChangeLog: * call.cc (add_list_candidates): Check for invalid designated initialization sooner and even for types that have a list constructor. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/desig27.C: New test. (cherry picked from commit d5e5007c4b534391c0a97be56f6024fde1a88682)