public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI
@ 2022-05-15  5:35 mrjoel at lixil dot net
  2022-05-15  6:35 ` [Bug c++/105606] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: mrjoel at lixil dot net @ 2022-05-15  5:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105606

            Bug ID: 105606
           Summary: [12 Regression] std::pair with nested struct and NSDMI
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mrjoel at lixil dot net
  Target Milestone: ---

The following snippets fail to compile with GCC 12.1.0. The first relates more
to actual code usage while the second I believe to be a more minimal
reproducer.

This looks closely related to the examples and discussion in bug 96645 and yet
this case compiles in versions through 11, only failing to compile in 12.

It may also be closely related to (or have it as an underlying cause) bug
102199.

Snippet 1
=========

#include <map>
#include <utility>

struct Outer {
    struct Inner {
        int a{0};
    };

    std::pair<Inner, int> p;

    void f() {
        std::map<int, std::pair<Inner, int>> m;
        m[0] = p;
    }
};

Snippet 2
=========

#include <utility>

struct Outer {
    struct Inner {
        int a{0}; // removing initialization compiles
    };

    std::pair<Inner, int> p; // commenting out compiles
    void f() {
        [[maybe_unused]] std::pair<Inner, int> localp;
    }
};

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

end of thread, other threads:[~2023-09-27  8:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-15  5:35 [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI mrjoel at lixil dot net
2022-05-15  6:35 ` [Bug c++/105606] " pinskia at gcc dot gnu.org
2022-05-15  6:42 ` pinskia at gcc dot gnu.org
2022-05-15  6:44 ` pinskia at gcc dot gnu.org
2022-05-15  7:00 ` [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI and -std=c++20 mrjoel at lixil dot net
2022-05-15  7:08 ` pinskia at gcc dot gnu.org
2022-05-15  7:09 ` pinskia at gcc dot gnu.org
2023-09-27  8:39 ` cvs-commit at gcc dot gnu.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).