public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101889] New: [11/12 Regression] ICE with template argument deduction of broken template
Date: Thu, 12 Aug 2021 18:08:42 +0000	[thread overview]
Message-ID: <bug-101889-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101889
           Summary: [11/12 Regression] ICE with template argument
                    deduction of broken template
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 11:

==============================
template<int> struct A {};

template<T> struct B
{
  enum { E = 0 };
  B(A<E>) {}
};

B b = A<0>();
==============================

bug.cc:3:10: error: 'T' has not been declared
    3 | template<T> struct B
      |          ^
bug.cc:9:12: internal compiler error: tree check: expected enumeral_type, have
error_mark in tsubst_copy, at cp/pt.c:16588
    9 | B b = A<0>();
      |            ^
0x85a540 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:8686
0x6e74ea tree_check(tree_node*, char const*, int, char const*, tree_code)
        ../../gcc/gcc/tree.h:3373
0x6e74ea tsubst_copy
        ../../gcc/gcc/cp/pt.c:16588
0xaf1eb4 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:20870
0xafd357 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:19092
0xb12264 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:13355
0xb1b763 tsubst_aggr_type
        ../../gcc/gcc/cp/pt.c:13559
0xb1be34 tsubst_arg_types
        ../../gcc/gcc/cp/pt.c:14958
0xb1ed5a tsubst_arg_types
        ../../gcc/gcc/cp/pt.c:14935
0xb1ed5a build_deduction_guide
        ../../gcc/gcc/cp/pt.c:28776
0xaec0b6 ctor_deduction_guides_for
        ../../gcc/gcc/cp/pt.c:29184
0xaec0b6 deduction_guides_for
        ../../gcc/gcc/cp/pt.c:29257
0xaec576 do_class_deduction
        ../../gcc/gcc/cp/pt.c:29378
0xaec576 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:29535
0x9d9608 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:7856
0xac5174 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:22556
0xaa0773 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:15088
0xacfdb5 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:14787
0xad078e cp_parser_toplevel_declaration
        ../../gcc/gcc/cp/parser.c:14808
0xad078e cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4978
Please submit a full bug report, [etc.]

             reply	other threads:[~2021-08-12 18:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 18:08 reichelt at gcc dot gnu.org [this message]
2021-08-13  7:51 ` [Bug c++/101889] [11/12 Regression] ICE with template argument deduction of broken template since r11-2748-gb871301f09be7061 marxin at gcc dot gnu.org
2021-08-16  8:56 ` rguenth at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` [Bug c++/101889] [11/12/13/14 " jakub 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-101889-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).