Commit bfbe1b68 by Jason Merrill Committed by Jason Merrill

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

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

From-SVN: r144092
parent 952e24fe
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.
......
......@@ -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;
......
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.
......
// 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" }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment