From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 47D5D3861970; Thu, 12 Aug 2021 18:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47D5D3861970 From: "reichelt at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: reichelt at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2021 18:08:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101889 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: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D template struct A {}; template struct B { enum { E =3D 0 }; B(A) {} }; B b =3D A<0>(); =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D bug.cc:3:10: error: 'T' has not been declared 3 | template struct B | ^ bug.cc:9:12: internal compiler error: tree check: expected enumeral_type, h= ave error_mark in tsubst_copy, at cp/pt.c:16588 9 | B b =3D 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*, boo= l, 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.]=