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

            Bug ID: 122090
           Summary: ICE: dependent_type_p, at cp/pt.cc:27843
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qingren2hxb at gmail dot com
  Target Milestone: ---

Created attachment 62464
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62464&action=edit
bug report by using -freport-bug

intput:

#include <type_traits>

template <template <typename T, typename T::type TT> typename X>
void func() {}

template <typename U, int I>
struct Y {};

int main() {
    func<Y>();
    return 0;
}

output:

$g++ -
test.cpp:11:12: internal compiler error: in dependent_type_p, at cp/pt.cc:27843
   11 |     func<Y>();
      |     ~~~~~~~^~
0x1303550 dependent_type_p(tree_node*)
        /workspace/gcc/gcc/cp/pt.cc:27843
0x130376b dependent_scope_p(tree_node*)
        /workspace/gcc/gcc/cp/pt.cc:27874
0xeb47cb make_typename_type(tree_node*, tree_node*, tag_types, int)
        /workspace/gcc/gcc/cp/decl.cc:4308
0x12a6b64 tsubst(tree_node*, tree_node*, int, tree_node*)
        /workspace/gcc/gcc/cp/pt.cc:16610
0x125c293 coerce_template_template_parm
        /workspace/gcc/gcc/cp/pt.cc:7831
0x125eb0f coerce_template_template_parms
        /workspace/gcc/gcc/cp/pt.cc:8193
0x12608a0 convert_template_argument
        /workspace/gcc/gcc/cp/pt.cc:8580
0x1264766 coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
        /workspace/gcc/gcc/cp/pt.cc:9174
0x12dcdc3 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        /workspace/gcc/gcc/cp/pt.cc:22456
0xcd89cf add_template_candidate_real
        /workspace/gcc/gcc/cp/call.cc:3602
0xcd92f4 add_template_candidate
        /workspace/gcc/gcc/cp/call.cc:3692
0xcebff7 add_candidates
        /workspace/gcc/gcc/cp/call.cc:6611
0xce092e perform_overload_resolution
        /workspace/gcc/gcc/cp/call.cc:4926
0xce0fb7 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        /workspace/gcc/gcc/cp/call.cc:5033
0x1361754 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**,
bool, bool, int)
        /workspace/gcc/gcc/cp/semantics.cc:2924
0x114b8c2 cp_parser_postfix_expression
        /workspace/gcc/gcc/cp/parser.cc:8003
0x11507e6 cp_parser_unary_expression
        /workspace/gcc/gcc/cp/parser.cc:9138
0x1152f75 cp_parser_cast_expression
        /workspace/gcc/gcc/cp/parser.cc:10044
0x11530f5 cp_parser_binary_expression
        /workspace/gcc/gcc/cp/parser.cc:10147
0x1154e07 cp_parser_assignment_expression
        /workspace/gcc/gcc/cp/parser.cc:10491
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to