===================================================================
@@ -1,3 +1,9 @@
+2010-11-13 Ville Voutilainen <ville.voutilainen@gmail.com> <ville.voutilainen@symbio.com>
+
+ * method.c (defaultable_fn_check): Do not disallow defaulting a
+ non-public or explicit special member function on its first
+ declaration.
+
2010-11-11 Jan Hubicka <jh@suse.cz>
* opts.c (finish_options): Do not error on -flto-partition alone.
===================================================================
@@ -11,24 +11,24 @@
struct B
{
private:
- B() = default; // { dg-error "access" }
+ B() = default;
};
struct C
{
protected:
- ~C() = default; // { dg-error "access" }
+ ~C() = default;
};
struct D
{
private:
- D& operator= (const D&) = default; // { dg-error "access" }
+ D& operator= (const D&) = default;
};
struct E
{
- explicit E (const E&) = default; // { dg-error "explicit" }
+ explicit E (const E&) = default;
};
struct F
===================================================================
@@ -1628,12 +1628,6 @@
}
if (TYPE_BEING_DEFINED (DECL_CONTEXT (fn)))
{
- if (DECL_NONCONVERTING_P (fn))
- error ("%qD declared explicit cannot be defaulted in the class "
- "body", fn);
- if (current_access_specifier != access_public_node)
- error ("%qD declared with non-public access cannot be defaulted "
- "in the class body", fn);
if (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn)))
error ("function %q+D defaulted on its first declaration "
"must not have an exception-specification", fn);