public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101803] New: CTAD fails for nested designated initializers
@ 2021-08-06 13:46 h2+bugs at fsfe dot org
  2021-08-18 12:53 ` [Bug c++/101803] " ppalka at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: h2+bugs at fsfe dot org @ 2021-08-06 13:46 UTC (permalink / raw)
  To: gcc-bugs

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
}

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-06-02 14:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 13:46 [Bug c++/101803] New: CTAD fails for nested designated initializers h2+bugs at fsfe dot org
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

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).