2018-03-09 Jason Merrill <jason@redhat.com>
+ 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.
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);
--- /dev/null
+// PR c++/84785
+// { dg-do compile { target c++11 } }
+
+template <typename> struct A;
+template <bool> struct B;
+template <bool B, typename> using enable_if_t = typename B<B>::type;
+template <long> using type_pack_element = int;
+struct variant {
+ variant() {}
+ template <typename Arg, long I = Arg::type::value,
+ typename = type_pack_element<I>, enable_if_t<A<Arg>::value, int>>
+ variant(Arg &&);
+};
+
+struct S {
+ variant var;
+};
+int main() { S s; }