+2018-03-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/84937 - ICE with class deduction and auto.
+ * pt.c (rewrite_template_parm): Fix auto handling.
+
2018-03-19 Marek Polacek <polacek@redhat.com>
PR c++/84925
(cxx_eval_constant_expression): Verify constructor's flags
unconditionally.
-2018-03-16 Jason Merrill <jason@redhat.com>
+2018-03-19 Jason Merrill <jason@redhat.com>
PR c++/71834 - template-id with too few arguments.
* pt.c (coerce_template_parms): Check fixed_parameter_pack_p.
= TEMPLATE_TYPE_PARM_FOR_CLASS (oldtype);
}
else
- newtype = tsubst (TREE_TYPE (olddecl), tsubst_args,
- complain, NULL_TREE);
+ {
+ newtype = TREE_TYPE (olddecl);
+ if (type_uses_auto (newtype))
+ {
+ // Substitute once to fix references to other template parameters.
+ newtype = tsubst (newtype, tsubst_args,
+ complain|tf_partial, NULL_TREE);
+ // Now substitute again to reduce the level of the auto.
+ newtype = tsubst (newtype, current_template_args (),
+ complain, NULL_TREE);
+ }
+ else
+ newtype = tsubst (newtype, tsubst_args,
+ complain, NULL_TREE);
+ }
tree newdecl
= build_decl (DECL_SOURCE_LOCATION (olddecl), TREE_CODE (olddecl),
--- /dev/null
+// PR c++/84937
+// { dg-additional-options -std=c++17 }
+
+template<int, int> struct A {};
+
+template<int I> struct B
+{
+ template<auto J> B(A<I,J>);
+};
+
+B b(A<0,0>{});