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

            Bug ID: 90170
           Summary: [7/8/9 Regression] ICE in unify, at cp/pt.c:22209
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-9.0.0-alpha20190414 snapshot (r270355) ICEs when compiling the following
testcase extracted from test/SemaTemplate/temp_arg_nontype.cpp from the clang
8.0.0 test suite w/ -std=c++17:

namespace partial_order_different_types {
  template<int, int, typename T, typename, T> struct A;

  // FIXME: It appears that this partial specialization should be ill-formed as
  // it is not more specialized than the primary template. V is not deducible
  // because it does not have the same type as the corresponding parameter.
  template<int N, typename T, typename U, U V> struct A<0, N, T, U, V> {}; //
expected-note {{matches}}
}

% g++-9.0.0-alpha20190414 -std=c++17 -c zaccgjmf.cpp
zaccgjmf.cpp:7:55: internal compiler error: in unify, at cp/pt.c:22209
    7 |   template<int N, typename T, typename U, U V> struct A<0, N, T, U, V>
{}; // expected-note {{matches}}
      |                                                       ^~~~~~~~~~~~~~~~
0x620a62 unify
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22209
0x9d05a8 unify
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22391
0x9d0116 unify
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:22553
0x9d15ff get_partial_spec_bindings
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:23366
0x9f98fa process_partial_specialization
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:4883
0x9f9c45 push_template_decl_real(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5619
0x9fbeb7 push_template_decl_real(tree_node*, bool)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5846
0x9fbeb7 push_template_decl(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5848
0x9fbeb7 push_template_decl(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:5846
0x9fbeb7 maybe_process_partial_specialization(tree_node*)
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/pt.c:1014
0x98d054 cp_parser_class_head
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:24021
0x98d054 cp_parser_class_specifier_1
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:23362
0x98d9d8 cp_parser_class_specifier
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:23686
0x98d9d8 cp_parser_type_specifier
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:17431
0x98e944 cp_parser_decl_specifier_seq
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:14124
0x9b0ba8 cp_parser_single_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28177
0x9b0f3d cp_parser_template_declaration_after_parameters
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:27860
0x9b188e cp_parser_explicit_template_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28106
0x9b188e cp_parser_template_declaration_after_export
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:28125
0x9b4459 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-9.0.0_alpha20190414/work/gcc-9-20190414/gcc/cp/parser.c:13187

It may be a duplicate of PR89480, though.

Reply via email to