[Bug c++/97639] New: [c++20,-fconcepts-ts] ICE: gcc_assert in tsubst, cp/pt.c:15464

dimitri.gorokhovik at free dot fr gcc-bugzilla@gcc.gnu.org
Fri Oct 30 11:16:37 GMT 2020


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

            Bug ID: 97639
           Summary: [c++20,-fconcepts-ts] ICE: gcc_assert in tsubst,
                    cp/pt.c:15464
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimitri.gorokhovik at free dot fr
  Target Milestone: ---

The code:


template <auto> concept Term = true;
template <auto, auto> struct ss {};

template <auto> struct s
{
  template <Term a, Term b> constexpr static auto foo (ss <a, b>);
};

constexpr auto g = [] (auto) { return 41; };
constexpr auto r = s <42> {}.foo (ss <g,g> {});



when compiled as:
g++ -fconcepts-ts  -std=c++20 -o bug-10.o -c  bug-10.cpp

produces:

bug-10.cpp: In substitution of ‘template<auto a, auto b>  requires (Term<a>) &&
(Term<b>) static constexpr auto s<42>::foo<a, b>(ss<a, b>) [with auto a =
<missing>; auto b = <missing>]’:
bug-10.cpp:10:46:   required from here
bug-10.cpp:10:46: internal compiler error: in tsubst, at cp/pt.c:15464
   10 | constexpr auto r = s <42> {}.foo (ss <g,g> {});
      |                                              ^
0x6b046b tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../src/gcc/cp/pt.c:15464
0xa66be6 unify
        ../../src/gcc/cp/pt.c:23443
0xa6689c unify
        ../../src/gcc/cp/pt.c:23640
0xa64a68 try_class_unification
        ../../src/gcc/cp/pt.c:22629
0xa65162 unify
        ../../src/gcc/cp/pt.c:23677
0xa62822 unify_one_argument
        ../../src/gcc/cp/pt.c:21850
0xa71a23 type_unification_real
        ../../src/gcc/cp/pt.c:21969
0xa7fe29 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ../../src/gcc/cp/pt.c:21338
0x8d1c3d add_template_candidate_real
        ../../src/gcc/cp/call.c:3412
0x8d261c add_template_candidate
        ../../src/gcc/cp/call.c:3497
0x8d261c add_candidates
        ../../src/gcc/cp/call.c:5910
0x8d8ad4 add_candidates
        ../../src/gcc/cp/call.c:5825
0x8d8ad4 build_new_method_call_1
        ../../src/gcc/cp/call.c:10330
0x8d9d7f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../src/gcc/cp/call.c:10537
0xa1305c cp_parser_postfix_expression
        ../../src/gcc/cp/parser.c:7517
0x9f3c6a cp_parser_binary_expression
        ../../src/gcc/cp/parser.c:9652
0x9f59fe cp_parser_assignment_expression
        ../../src/gcc/cp/parser.c:9957
0x9f457d cp_parser_constant_expression
        ../../src/gcc/cp/parser.c:10251
0x9f4da1 cp_parser_initializer_clause
        ../../src/gcc/cp/parser.c:23404
0x9f978c cp_parser_initializer
        ../../src/gcc/cp/parser.c:23342
Please submit a full bug report,


GCC version: g++ (GCC) 11.0.0 20201029 (experimental)


More information about the Gcc-bugs mailing list