https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94210
Bug ID: 94210 Summary: ICE in tsubst, at cp/pt.c:15105 Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: tangyixuan at mail dot dlut.edu.cn Target Milestone: --- Hi, gcc crashes given the following example, while clang compiles normally. $ cat 1.cpp template<typename ...T> struct X {}; namespace Nested { template<typename ...T> int f1(X<T, T...>... a); int a1 = f1(X<int, int, double>(), X<double, int, double>()); } $ g++ -v Using built-in specs. COLLECT_GCC=/usr/local/gcc-20200315/bin/g++ COLLECT_LTO_WRAPPER=/usr/local/gcc-20200315/libexec/gcc/x86_64-pc-linux-gnu/10.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-10-20200315/configure --prefix=/usr/local/gcc-20200315 --enable-checking=release --enable-languages=c,c++ --disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.0.1 20200315 (experimental) (GCC) $ g++ -c -std=c++11 1.cpp 1.cpp: In substitution of ‘template<class ... T> int Nested::f1(X<T, T ...>...) [with T = <missing>]’: 1.cpp:6:62: required from here 1.cpp:6:62: internal compiler error: in tsubst, at cp/pt.c:15105 6 | int a1 = f1(X<int, int, double>(), X<double, int, double>()); | ^ 0x5f0f06 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc-10-20200315/gcc/cp/pt.c:15105 0x75dd9a unify_pack_expansion ../../gcc-10-20200315/gcc/cp/pt.c:22534 0x74aff5 unify ../../gcc-10-20200315/gcc/cp/pt.c:23307 0x74a20a unify ../../gcc-10-20200315/gcc/cp/pt.c:23204 0x74ae8b unify ../../gcc-10-20200315/gcc/cp/pt.c:23301 0x75e5da try_class_unification ../../gcc-10-20200315/gcc/cp/pt.c:22298 0x74a744 unify ../../gcc-10-20200315/gcc/cp/pt.c:23338 0x75d248 unify_one_argument ../../gcc-10-20200315/gcc/cp/pt.c:21531 0x75db29 unify_pack_expansion ../../gcc-10-20200315/gcc/cp/pt.c:22546 0x749b80 type_unification_real ../../gcc-10-20200315/gcc/cp/pt.c:21670 0x769684 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node* const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool, bool) ../../gcc-10-20200315/gcc/cp/pt.c:21030 0x640da5 add_template_candidate_real ../../gcc-10-20200315/gcc/cp/call.c:3396 0x6414f4 add_template_candidate ../../gcc-10-20200315/gcc/cp/call.c:3481 0x6414f4 add_candidates ../../gcc-10-20200315/gcc/cp/call.c:5834 0x6418f7 add_candidates ../../gcc-10-20200315/gcc/cp/call.c:4482 0x6418f7 perform_overload_resolution ../../gcc-10-20200315/gcc/cp/call.c:4490 0x644525 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, int) ../../gcc-10-20200315/gcc/cp/call.c:4564 0x77bd5c finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int) ../../gcc-10-20200315/gcc/cp/semantics.c:2671 0x71f998 cp_parser_postfix_expression ../../gcc-10-20200315/gcc/cp/parser.c:7427 0x7041ba cp_parser_binary_expression ../../gcc-10-20200315/gcc/cp/parser.c:9519 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.