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

            Bug ID: 93867
           Summary: ICE using class type NTTPs and class template argument
                    deduction
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pkeir at outlook dot com
  Target Milestone: ---

Created attachment 47881
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47881&action=edit
The code described in the bug report.

The attached C++20 code makes use of class type NTTPs, and also class template
argument deduction. It is based on code from P0732r2. With the -std=c++2a
switch the code produces an ICE on GCC snapshot gcc-10-20200216. The error
message is below:

nttp_ice.cpp: In function ‘int main(int, const char**)’:
nttp_ice.cpp:27:16: internal compiler error: in alias_ctad_tweaks, at
cp/pt.c:28327
   27 |   foo<"hello">();
      |                ^
0x67b060 alias_ctad_tweaks
        ../../gcc/cp/pt.c:28327
0x67b060 deduction_guides_for
        ../../gcc/cp/pt.c:28499
0x9fc488 do_class_deduction
        ../../gcc/cp/pt.c:28604
0x9fc488 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
        ../../gcc/cp/pt.c:28733
0x9fe129 convert_template_argument
        ../../gcc/cp/pt.c:8306
0x9fff7b coerce_template_parms
        ../../gcc/cp/pt.c:8810
0xa32fac fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
        ../../gcc/cp/pt.c:20919
0x8951ed add_template_candidate_real
        ../../gcc/cp/call.c:3396
0x895c04 add_template_candidate
        ../../gcc/cp/call.c:3481
0x895c04 add_candidates
        ../../gcc/cp/call.c:5830
0x8960c7 add_candidates
        ../../gcc/cp/call.c:4478
0x8960c7 perform_overload_resolution
        ../../gcc/cp/call.c:4486
0x89bdb5 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/cp/call.c:4560
0xa4ec54 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/cp/semantics.c:2671
0x9c848d cp_parser_postfix_expression
        ../../gcc/cp/parser.c:7427
0x9ab24a cp_parser_binary_expression
        ../../gcc/cp/parser.c:9519
0x9acd0c cp_parser_assignment_expression
        ../../gcc/cp/parser.c:9824
0x9ad032 cp_parser_expression
        ../../gcc/cp/parser.c:9992
0x9aff26 cp_parser_expression_statement
        ../../gcc/cp/parser.c:11642
0x9bb083 cp_parser_statement
        ../../gcc/cp/parser.c:11438

Reply via email to