+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37766
+ * pt.c (type_unification_real): Call convert_template_argument
+ for function default template arguments.
+ (check_default_tmpl_args): Suggest -std=c++0x when function default
+ template args seen in C++98 mode.
+
2009-10-11 Jason Merrill <jason@redhat.com>
PR c++/37204
else if (is_friend_decl)
msg = "default template arguments may not be used in function template friend declarations";
else if (TREE_CODE (decl) == FUNCTION_DECL && (cxx_dialect == cxx98))
- msg = "default template arguments may not be used in function templates";
+ msg = ("default template arguments may not be used in function templates "
+ "without -std=c++0x or -std=gnu++0x");
else if (is_partial)
msg = "default template arguments may not be used in partial specializations";
else
to explicitly check cxx_dialect here. */
if (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)))
{
- tree arg = tsubst_template_arg
- (TREE_PURPOSE (TREE_VEC_ELT (tparms, i)),
- targs, tf_none, NULL_TREE);
+ tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
+ tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i));
+ arg = tsubst_template_arg (arg, targs, tf_none, NULL_TREE);
+ arg = convert_template_argument (parm, arg, targs, tf_none,
+ i, NULL_TREE);
if (arg == error_mark_node)
return 1;
else
+2009-10-12 Jason Merrill <jason@redhat.com>
+
+ PR c++/37766
+ * g++.dg/cpp0x/fntmpdefarg1.C: New.
+
2009-10-12 Janis Johnson <janis187@us.ibm.com>
* gcc.dg/lto/20090914-2.c: Fix typos in test directives.