PR c++/48280
* method.c (defaultable_fn_check): Templates are not defaultable.
From-SVN: r171797
2011-03-31 Jason Merrill <jason@redhat.com>
+ PR c++/48280
+ * method.c (defaultable_fn_check): Templates are not defaultable.
+
* parser.c (cp_parser_init_declarator): Avoid redundant
cp_finish_decl for member declarations.
{
special_function_kind kind = sfk_none;
+ if (template_parm_scope_p ())
+ {
+ error ("a template cannot be defaulted");
+ return false;
+ }
+
if (DECL_CONSTRUCTOR_P (fn))
{
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
+2011-03-31 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/cpp0x/defaulted24.C: New.
+
2011-03-31 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR target/16292
--- /dev/null
+// PR c++/48280
+// { dg-options -std=c++0x }
+
+struct S {
+ template < typename > S (const S &) = default; // { dg-error "" }
+};