public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "janezz55 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107514] New: quick crash of gcc due to noexcept specification
Date: Thu, 03 Nov 2022 08:36:00 +0000	[thread overview]
Message-ID: <bug-107514-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 107514
           Summary: quick crash of gcc due to noexcept specification
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: janezz55 at gmail dot com
  Target Milestone: ---

The noexcept specification is probably c++ non-complaint, but still causes a
crash:

constexpr void assign_tuple(auto& t, auto&& ...a)
  noexcept(noexcept(
      []<auto ...I>(std::index_sequence<I...>)
        noexcept(noexcept(
            ((std::get<I>(t) = std::forward<decltype(a)>(a)), ...)
          )
        )
      {
      }(std::make_index_sequence<sizeof...(a)>())
    )
  )
{
  [&]<auto ...I>(std::index_sequence<I...>)
    noexcept(noexcept(((std::get<I>(t) = std::forward<decltype(a)>(a)), ...)))
  {
    ((std::get<I>(t) = std::forward<decltype(a)>(a)), ...);
  }(std::make_index_sequence<sizeof...(a)>());
}

prog.cc: In instantiation of 'assign_tuple<std::tuple<int, int, int>, int, int,
int>(std::tuple<int, int, int>&, int&&, int&&,
int&&)::<lambda(std::index_sequence<I ...>)> [with auto ...I = {0, 1, 2};
std::index_sequence<I ...> = std::integer_sequence<long unsigned int, 0, 1,
2>]':
prog.cc:21:4:   required from 'constexpr void assign_tuple(auto:1&, auto:2&&
...) [with auto:1 = std::tuple<int, int, int>; auto:2 = {int, int, int}]'
prog.cc:29:15:   required from here
prog.cc:18:73: internal compiler error: Segmentation fault
   18 |     noexcept(noexcept(((std::get<I>(t) = std::forward<decltype(a)>(a)),
...)))
      |                      
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~

The source is here:
https://wandbox.org/permlink/alJJGFEkTE8b7EXn

I can't provide anything else, since I typed it in over at wandbox. I suspect
the bug is a duplicate anyway. clang does not crash while compiling the
snippet.

             reply	other threads:[~2022-11-03  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03  8:36 janezz55 at gmail dot com [this message]
2022-11-03  9:50 ` [Bug c++/107514] " janezz55 at gmail dot com
2022-11-05 10:54 ` rguenth at gcc dot gnu.org
2022-11-05 13:30 ` janezz55 at gmail dot com
2022-11-08  1:31 ` ppalka at gcc dot gnu.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-107514-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: link
Be 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).