public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "stevenxia990430 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/110031] New: ICE: error reporting routines re-entered on non-type template argument
Date: Mon, 29 May 2023 22:45:53 +0000	[thread overview]
Message-ID: <bug-110031-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 110031
           Summary: ICE: error reporting routines re-entered on non-type
                    template argument
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following program produces internal compiler error: error reporting
routines re-entered. Checked on clang and it was rejected as invalid code.
Tested on gcc trunk. 


To quickly reproduce: https://gcc.godbolt.org/z/ex14EKeox
```
#include <type_traits>

#include <iostream>
template <typename T>
constexpr void print_type()
{
  std::cout << "Type: " << typeid(T).name();
}
template <typename T, std::enable_if_t<std::is_literal_type_v<std::decay_t<T>>,
int> = 0>
struct A {
  A(T &&)
  {
  }
};

template <typename T>
struct A<T> {
  A(T &&) = delete;
};

int main(void)
{
  A a{5.3};
  return 0;
}
```

Note, if we comment out the A a{5.3}; line in main function, gcc-trunk actually
accept this code (compiles) however it is rejected by clang. Might be related
to  this: bug109390

             reply	other threads:[~2023-05-29 22:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-29 22:45 stevenxia990430 at gmail dot com [this message]
2023-05-30  3:41 ` [Bug c++/110031] " pinskia at gcc dot gnu.org
2023-05-30  3:49 ` [Bug c++/110031] [10/11/12/13/14 Regression] ICE with deprecated attribute and NTTP and diagnostic for deprecated printed out so much pinskia at gcc dot gnu.org
2023-05-30  4:31 ` stevenxia990430 at gmail dot com
2023-07-07 10:45 ` [Bug c++/110031] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-01-12 13:57 ` rguenth at gcc dot gnu.org
2024-01-12 13:58 ` rguenth at gcc dot gnu.org
2024-03-04 17:10 ` mpolacek at gcc dot gnu.org
2024-03-04 17:15 ` mpolacek at gcc dot gnu.org
2024-03-07 15:01 ` cvs-commit at gcc dot gnu.org
2024-03-07 15:02 ` [Bug c++/110031] [11/12/13 " mpolacek 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-110031-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).