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:
parent
952e24fed6
commit
bfbe1b687b
4 changed files with 18 additions and 3 deletions
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
8
gcc/testsuite/g++.dg/cpp0x/defaulted8.C
Normal file
8
gcc/testsuite/g++.dg/cpp0x/defaulted8.C
Normal 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" }
|
||||
};
|
Loading…
Add table
Reference in a new issue