Bug 107150 - ICE: tree check: expected function_type or method_type, have lang_type in deduce_noexcept_on_destructor, at cp/class.cc:5183
Summary: ICE: tree check: expected function_type or method_type, have lang_type in ded...
Status: RESOLVED DUPLICATE of bug 96745
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2022-10-04 10:50 UTC by Arseny Solokha
Modified: 2023-02-03 14:23 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arseny Solokha 2022-10-04 10:50:09 UTC
g++ 13.0.0 20220925 snapshot (g:77bbf69d2981dafc2ef3e59bfbefb645d88bab9d) ICEs when compiling the following testcase, reduced from clang/testsuite/CXX/class/class.dtor/p4.cpp from the clang 15.0.1 test suite:

template <int N>
struct D {
  ~D() requires(N != 0) = delete;
  ~D() requires(N == 1) = delete;
};

template struct D<0>;

% g++-13.0.0 -fconcepts -c ghba8ll9.cpp
ghba8ll9.cpp: In instantiation of 'struct D<0>':
ghba8ll9.cpp:7:17:   required from here
ghba8ll9.cpp:2:8: internal compiler error: tree check: expected function_type or method_type, have lang_type in deduce_noexcept_on_destructor, at cp/class.cc:5183
    2 | struct D {
      |        ^
0x891780 tree_check_failed(tree_node const*, char const*, int, char const*, ...)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/tree.cc:8827
0x690b3a tree_check2(tree_node*, char const*, int, char const*, tree_code, tree_code)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/tree.h:3539
0x690b3a deduce_noexcept_on_destructor(tree_node*)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/class.cc:5183
0x99d6c9 check_bases_and_members
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/class.cc:6045
0x9a150b finish_struct_1(tree_node*)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/class.cc:7492
0xb8ead0 instantiate_class_template(tree_node*)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:12468
0xbe5c28 complete_type(tree_node*)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/typeck.cc:138
0xb850ca do_type_instantiation(tree_node*, tree_node*, int)
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/pt.cc:26074
0xb1ea7f cp_parser_explicit_instantiation
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:19262
0xb308ac cp_parser_declaration
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:15075
0xb31509 cp_parser_toplevel_declaration
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:15130
0xb31509 cp_parser_translation_unit
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:5068
0xb31509 c_parse_file()
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/cp/parser.cc:48606
0xc6e3a1 c_common_parse_file()
	/var/tmp/portage/sys-devel/gcc-13.0.0_p20220925/work/gcc-13-20220925/gcc/c-family/c-opts.cc:1255

g++ 12 and earlier releases ICE with a splat identical to the one reported in PR96745. I'm not sure if this PR is a duplicate of that earlier one.
Comment 1 Martin Liška 2022-10-04 11:01:31 UTC
Started with r8-2664-g2e12a8554c9ed35f.
Comment 2 Patrick Palka 2023-02-03 14:23:37 UTC
dup

*** This bug has been marked as a duplicate of bug 96745 ***