+2015-10-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53856
+ * pt.c (check_default_tmpl_args): Per [temp.param]/9, do not
+ reject default template arguments in out of class definitions
+ of members of non-template classes.
+
2015-10-05 Richard Sandiford <richard.sandiford@arm.com>
* tree.c (cp_tree_equal): Use real_equal instead of
else if (is_partial)
msg = G_("default template arguments may not be used in "
"partial specializations");
- else
+ else if (current_class_type && CLASSTYPE_IS_TEMPLATE (current_class_type))
msg = G_("default argument for template parameter for class enclosing %qD");
+ else
+ /* Per [temp.param]/9, "A default template-argument shall not be
+ specified in the template-parameter-lists of the definition of
+ a member of a class template that appears outside of the member's
+ class.", thus if we aren't handling a member of a class template
+ there is no need to examine the parameters. */
+ return true;
if (current_class_type && TYPE_BEING_DEFINED (current_class_type))
/* If we're inside a class definition, there's no need to
+2015-10-05 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53856
+ * g++.dg/template/defarg19.C: New.
+ * g++.dg/template/defarg20.C: Likewise.
+
2015-10-05 Aditya Kumar <aditya.k7@samsung.com>
Sebastian Pop <s.pop@samsung.com>