From: Jason Merrill Date: Sat, 10 Mar 2018 03:34:29 +0000 (-0500) Subject: PR c++/84785 - ICE with alias template and default targs. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=732a431dc94ae7f921e21245061946a1cfe8d9b5;p=gcc.git PR c++/84785 - ICE with alias template and default targs. * pt.c (type_unification_real): Set processing_template_decl if saw_undeduced == 1. From-SVN: r258407 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 05cfb768bc6..95ed64d464d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2018-03-09 Jason Merrill + PR c++/84785 - ICE with alias template and default targs. + * pt.c (type_unification_real): Set processing_template_decl if + saw_undeduced == 1. + PR c++/84752 - ICE with capture of constexpr array. * call.c (standard_conversion): Set rvaluedness_matches_p on the identity conversion under ck_lvalue. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bc815d29764..d91e8bb559f 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -19977,7 +19977,13 @@ type_unification_real (tree tparms, location_t save_loc = input_location; if (DECL_P (parm)) input_location = DECL_SOURCE_LOCATION (parm); + + if (saw_undeduced == 1) + ++processing_template_decl; arg = tsubst_template_arg (arg, full_targs, fcomplain, NULL_TREE); + if (saw_undeduced == 1) + --processing_template_decl; + if (arg != error_mark_node && !uses_template_parms (arg)) arg = convert_template_argument (parm, arg, full_targs, complain, i, NULL_TREE); diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C new file mode 100644 index 00000000000..04fb42d9e09 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C @@ -0,0 +1,18 @@ +// PR c++/84785 +// { dg-do compile { target c++11 } } + +template struct A; +template struct B; +template using enable_if_t = typename B::type; +template using type_pack_element = int; +struct variant { + variant() {} + template , enable_if_t::value, int>> + variant(Arg &&); +}; + +struct S { + variant var; +}; +int main() { S s; }