re PR c++/38649 (Trouble with defaulted constructors)

PR c++/38649
        * class.c (defaultable_fn_p): Handle ... properly.

From-SVN: r144092
This commit is contained in:
Jason Merrill 2009-02-11 00:23:38 -05:00 committed by Jason Merrill
parent 952e24fed6
commit bfbe1b687b
4 changed files with 18 additions and 3 deletions

View file

@ -1,5 +1,8 @@
2009-02-10 Jason Merrill <jason@redhat.com>
PR c++/38649
* class.c (defaultable_fn_p): Handle ... properly.
PR c++/36744
* tree.c (lvalue_p_1): Condition rvalue ref handling on
treat_class_rvalues_as_lvalues, too.

View file

@ -4138,10 +4138,11 @@ defaultable_fn_p (tree fn)
{
if (DECL_CONSTRUCTOR_P (fn))
{
if (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
== NULL_TREE)
if (FUNCTION_FIRST_USER_PARMTYPE (fn) == void_list_node)
return true;
else if (copy_fn_p (fn) > 0)
else if (copy_fn_p (fn) > 0
&& (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn))
== void_list_node))
return true;
else
return false;

View file

@ -1,5 +1,8 @@
2009-02-11 Jason Merrill <jason@redhat.com>
PR c++/38649
* g++.dg/cpp0x/defaulted8.C: New test.
PR c++/36744
* g++.dg/cpp0x/rv9p.C: New test.

View file

@ -0,0 +1,8 @@
// PR c++/38649
// { dg-options "-std=c++0x" }
struct A
{
A(...) = default; // { dg-error "cannot be defaulted" }
A(const A&, ...) = default; // { dg-error "cannot be defaulted" }
};