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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI
  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 ` pinskia at gcc dot gnu.org
  2022-05-15  6:42 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15  6:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Both examples compile just fine with the released GCC 12. You must be using a
pre-released version when testing.

*** This bug has been marked as a duplicate of bug 96645 ***

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15  6:42 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |---

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Wait you didn't mention you needed -std=c++20 to get the failure.

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15  6:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note clang also rejects it for -std=c++20 and accepts it for -std=c++17.

Let me dig into the changes, I suspect this is another standard change.

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI and -std=c++20
  2022-05-15  5:35 [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI mrjoel at lixil dot net
                   ` (2 preceding siblings ...)
  2022-05-15  6:44 ` pinskia at gcc dot gnu.org
@ 2022-05-15  7:00 ` mrjoel at lixil dot net
  2022-05-15  7:08 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mrjoel at lixil dot net @ 2022-05-15  7:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Joel Johnson <mrjoel at lixil dot net> ---
> Wait you didn't mention you needed -std=c++20 to get the failure.

Ah indeed, my apologies!

I'm unable to reproduce the Clang failure using -std=c++20, at least in a quick
godbolt check at https://godbolt.org/z/3W4xeYdWs.

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI and -std=c++20
  2022-05-15  5:35 [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI mrjoel at lixil dot net
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There was libstdc++ change to better support C++20.

*** This bug has been marked as a duplicate of bug 102199 ***

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI and -std=c++20
  2022-05-15  5:35 [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI mrjoel at lixil dot net
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-05-15  7:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Joel Johnson from comment #4)
> > Wait you didn't mention you needed -std=c++20 to get the failure.
> 
> Ah indeed, my apologies!
> 
> I'm unable to reproduce the Clang failure using -std=c++20, at least in a
> quick godbolt check at https://godbolt.org/z/3W4xeYdWs.

Try clang trunk. clang 14 in godbolt uses the libstdc++ headers from GCC
11.2.0.

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

* [Bug c++/105606] [12 Regression] std::pair with nested struct and NSDMI and -std=c++20
  2022-05-15  5:35 [Bug c++/105606] New: [12 Regression] std::pair with nested struct and NSDMI mrjoel at lixil dot net
                   ` (5 preceding siblings ...)
  2022-05-15  7:09 ` pinskia at gcc dot gnu.org
@ 2023-09-27  8:39 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-27  8:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:3ba882c7b51ab1f14c62c748e989415834ccd9ce

commit r14-4293-g3ba882c7b51ab1f14c62c748e989415834ccd9ce
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Sep 27 10:38:54 2023 +0200

    remove workaround for GCC 4.1-4.3 [PR105606]

    While looking into vec.h, I've noticed we still have a workaround for
    GCC 4.1-4.3 bugs.
    As we now use C++11 and thus need to be built by GCC 4.8 or later,
    I think this is now never used.

    2023-09-27  Jakub Jelinek  <jakub@redhat.com>

            PR c++/105606
            * system.h (BROKEN_VALUE_INITIALIZATION): Don't define.
            * vec.h (vec_default_construct): Remove BROKEN_VALUE_INITIALIZATION
            workaround.
            * function.cc (assign_parm_find_data_types): Likewise.

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