public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "h2+bugs at fsfe dot org" <gcc-bugzilla@gcc.gnu.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 [thread overview] Message-ID: <bug-101803-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101803 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 = 0; }; struct Outer2 { Inner s{}; }; template <typename T = int> struct Outer { Inner s{}; }; int main() { Outer2 o21{ .s = {} }; // works Outer2 o22{ .s = Inner{ .i = 1} }; // works Outer2 o23{ .s = { .i = 1} }; // works Outer2 o24{ .s{} }; // works Outer2 o25{ .s{Inner{ .i = 1} } }; // works Outer2 o26{ .s{ .i = 1} }; // works Outer o1{ .s = {} }; // works Outer o2{ .s = Inner{ .i = 1} }; // works // Outer o3{ .s = { .i = 1} }; // does not Outer o4{ .s{} }; // works Outer o5{ .s{Inner{ .i = 1} } }; // works // Outer o6{ .s{ .i = 1} }; // does not }
next reply other threads:[~2021-08-06 13:46 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-08-06 13:46 h2+bugs at fsfe dot org [this message] 2021-08-18 12:53 ` [Bug c++/101803] " ppalka at gcc dot gnu.org 2021-08-19 13:10 ` cvs-commit at gcc dot gnu.org 2021-10-06 14:15 ` cvs-commit at gcc dot gnu.org 2021-10-06 14:17 ` ppalka at gcc dot gnu.org 2021-11-26 11:40 ` h2+bugs at fsfe dot org 2022-05-31 19:58 ` h2+bugs at fsfe dot org 2022-06-02 13:21 ` ppalka at gcc dot gnu.org 2022-06-02 14:10 ` h2+bugs at fsfe dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-101803-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).