https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92531
Bug ID: 92531 Summary: [9/10 Regression] ICE in uses_template_parms, at cp/pt.c:10471 Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: asolokha at gmx dot com Target Milestone: --- g++-10.0.0-alpha20191110 snapshot (r278028) and g++ 9.2 ICE when compiling the following testcase w/ -std=c++17: template <typename XK> struct zq { void ky () noexcept ([]{}); }; % g++-10.0.0-alpha20191110 -std=c++17 -c as6atodv.cc as6atodv.cc:4:2: internal compiler error: in uses_template_parms, at cp/pt.c:10471 4 | }; | ^ 0x6302cc uses_template_parms(tree_node*) /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/pt.c:10471 0x995c9b canonical_eh_spec(tree_node*) /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/tree.c:2577 0x995ec2 build_cp_fntype_variant(tree_node*, cp_ref_qualifier, tree_node*, bool) /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/tree.c:2622 0x8ee22d cp_parser_class_specifier_1 /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:23908 0x8ef662 cp_parser_class_specifier /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:23965 0x8ef662 cp_parser_type_specifier /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:17566 0x8f0516 cp_parser_decl_specifier_seq /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:14239 0x9138ad cp_parser_single_declaration /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:28986 0x913c5b cp_parser_template_declaration_after_parameters /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:28649 0x914363 cp_parser_explicit_template_declaration /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:28915 0x9174c3 cp_parser_declaration /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:13271 0x9179ad cp_parser_translation_unit /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:4721 0x9179ad c_parse_file() /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/cp/parser.c:42900 0xa1a0d9 c_common_parse_file() /var/tmp/portage/sys-devel/gcc-10.0.0_alpha20191110/work/gcc-10-20191110/gcc/c-family/c-opts.c:1183 As a side note, clang 9.0.0 and icc 19.0.1 accept the testcase w/ the first line removed, while g++ rejects it: --- /home/asolokha/t1/as6atodv.cc +++ #<buffer as6atodv.cc> @@ -1,4 +1,3 @@ -template <typename XK> struct zq { void ky () noexcept ([]{}); };