seen with the gcc-9 branch 20200518, not with the gcc-10 branch. $ cat unique.ii # 7 "" 3 template <class b> struct c { using d = b; template <class bb, class e> auto operator()(bb l, e) -> decltype(d{l}); }; template <class f, template <class> class g> h() { using i = g<f>; int a[]{}; unsigned j; i{}(a, j); } k() { h<int *, c>(); } $ g++ -c -std=c++14 -Wall -fconcepts unique.ii : In instantiation of ‘decltype (c<b>::d{l}) c<b>::operator()(bb, e) [with bb = int*; e = unsigned int; b = int*]’: :9:37: internal compiler error: in dependent_type_p, at cp/pt.c:25610 0x7f56f3effe0a __libc_start_main ../csu/libc-start.c:308 Please submit a full bug report, with preprocessed source if appropriate.
I can't reproduce it. What version works for you?
the gcc-9 branch from 20200408 works for me. 20200615 also fails. : In instantiation of ‘decltype (c<b>::d{l}) c<b>::operator()(bb, e) [with bb = int*; e = unsigned int; b = int*]’: :9:37: internal compiler error: in dependent_type_p, at cp/pt.c:25619 0x5abade dependent_type_p(tree_node*) ../../src/gcc/cp/pt.c:25619 0x5abade dependent_type_p(tree_node*) ../../src/gcc/cp/pt.c:25610 0xd9e253 zero_init_expr_p(tree_node*) ../../src/gcc/cp/tree.c:4387 0x82b8a7 write_expression ../../src/gcc/cp/mangle.c:3177 0x11f7673 write_type ../../src/gcc/cp/mangle.c:2307 0xeaef6a write_encoding ../../src/gcc/cp/mangle.c:2688 0xeaef6a write_mangled_name ../../src/gcc/cp/mangle.c:789 0xeaef6a mangle_decl_string ../../src/gcc/cp/mangle.c:3839 0xeacbbf get_mangled_id ../../src/gcc/cp/mangle.c:3861 0xeacbbf mangle_decl(tree_node*) ../../src/gcc/cp/mangle.c:3899 0xe9b7ef decl_assembler_name(tree_node*) ../../src/gcc/tree.c:701 0xe9b7ef symbol_table::insert_to_assembler_name_hash(symtab_node*, bool) ../../src/gcc/symtab.c:174 0xe9b7ef symbol_table::insert_to_assembler_name_hash(symtab_node*, bool) ../../src/gcc/symtab.c:161 0xe9b7ef symbol_table::symtab_initialize_asm_name_hash() ../../src/gcc/symtab.c:266 0xe9b7ef symbol_table::symtab_initialize_asm_name_hash() ../../src/gcc/symtab.c:259 0xead95b analyze_functions ../../src/gcc/cgraphunit.c:1298 0xeac067 symbol_table::finalize_compilation_unit() ../../src/gcc/cgraphunit.c:2837 Please submit a full bug report, with preprocessed source if appropriate.
Judging by the backtrace, I suspect this is ICE is due to r9-8526. I think r10-7933 needs to be backported to the 9 branch.
The releases/gcc-9 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:d9867034e033c08fdabaebfe2f0914d7d9bb25c6 commit r9-8680-gd9867034e033c08fdabaebfe2f0914d7d9bb25c6 Author: Patrick Palka <ppalka@redhat.com> Date: Tue Jun 16 12:16:02 2020 -0400 c++: zero_init_expr_p of dependent expression [PR95678] gcc/cp/ChangeLog: PR c++/95678 * tree.c (zero_init_expr_p): Use uses_template_parms instead of dependent_type_p. gcc/testsuite/ChangeLog: PR c++/95678 * g++.dg/cpp0x/dependent3.C: New test. (cherry picked from commit 9a453da5cac7b6610cd342a7bea256acba5e61e1)
This should be fixed now.