public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101040] New: [11 Regression] Internal compiler error: in get_or_insert_ctor_field, at cp/constexpr.c:3571
@ 2021-06-12 11:36 git at foonathan dot net
  2021-06-14  6:48 ` [Bug c++/101040] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: git at foonathan dot net @ 2021-06-12 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101040
           Summary: [11 Regression] Internal compiler error: in
                    get_or_insert_ctor_field, at cp/constexpr.c:3571
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: git at foonathan dot net
  Target Milestone: ---

Minimal repro: https://godbolt.org/z/n71dhjPox

```
// This class has to be empty.
struct empty
{};

// This class has to be empty.
struct single
{
    // This member has to be no_unique_address.
    [[no_unique_address]] empty obj;
};

// This class has to be empty and derived from single.
struct derived : single
{
    // This constructor has to be constexpr and take a forwarding reference.
    template <typename Arg>
    constexpr derived(Arg&& arg) : single{arg}
    {}
};

auto obj = derived{empty{}};
```

Fails on GCC 11.1 and trunk:

```
source>:21:27:   in 'constexpr' expansion of 'derived(empty())'
<source>:21:27: internal compiler error: in get_or_insert_ctor_field, at
cp/constexpr.c:3571
   21 | auto obj = derived{empty{}};
      |                           ^
0x1d322a9 internal_error(char const*, ...)
        ???:0
0x71fc09 fancy_abort(char const*, int, char const*)
        ???:0
0xa58de0 store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ???:0
0x818a14 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ???:0
0x94812d c_parse_file()
        ???:0
0xacb002 c_common_parse_file()
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Works with GCC 10.3.

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

end of thread, other threads:[~2021-07-07 22:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 11:36 [Bug c++/101040] New: [11 Regression] Internal compiler error: in get_or_insert_ctor_field, at cp/constexpr.c:3571 git at foonathan dot net
2021-06-14  6:48 ` [Bug c++/101040] " rguenth at gcc dot gnu.org
2021-06-14  8:40 ` [Bug c++/101040] [11/12 Regression] Internal compiler error: in get_or_insert_ctor_field, at cp/constexpr.c:3571 since r11-7980-gc3d3bb0f03dbd025 marxin at gcc dot gnu.org
2021-06-21 18:04 ` jason at gcc dot gnu.org
2021-06-26  4:13 ` cvs-commit at gcc dot gnu.org
2021-06-26  4:16 ` jason at gcc dot gnu.org
2021-07-07 21:36 ` cvs-commit at gcc dot gnu.org
2021-07-07 22:52 ` jason 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).