From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9AAA8396BC04; Fri, 6 Aug 2021 13:46:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9AAA8396BC04 From: "h2+bugs at fsfe dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/101803] New: CTAD fails for nested designated initializers Date: Fri, 06 Aug 2021 13:46:09 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: h2+bugs at fsfe dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 13:46:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101803 Bug ID: 101803 Summary: CTAD fails for nested designated initializers Product: gcc Version: 11.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: h2+bugs at fsfe dot org Target Milestone: --- See the code below. Two initializing statements fail to build, although they shouldn't influence CTAD of the outer type at all (IMHO). struct Inner { int i =3D 0; }; struct Outer2 { Inner s{}; }; template struct Outer { Inner s{}; }; int main() { Outer2 o21{ .s =3D {} }; // works Outer2 o22{ .s =3D Inner{ .i =3D 1} }; // works Outer2 o23{ .s =3D { .i =3D 1} }; // works Outer2 o24{ .s{} }; // works Outer2 o25{ .s{Inner{ .i =3D 1} } }; // works Outer2 o26{ .s{ .i =3D 1} }; // works Outer o1{ .s =3D {} }; // works Outer o2{ .s =3D Inner{ .i =3D 1} }; // works // Outer o3{ .s =3D { .i =3D 1} }; // does not Outer o4{ .s{} }; // works Outer o5{ .s{Inner{ .i =3D 1} } }; // works // Outer o6{ .s{ .i =3D 1} }; // does not }=