diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-04-26 23:32:14 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-04-26 23:32:14 +0000 |
commit | df16e146cf5355d7faeee0812206a0a688643de9 (patch) | |
tree | dcf120c2e03b88960b03842a63d33845340766ed /gcc/cp | |
parent | fd59643c209efc38aeda606675357ea3f0afe0b8 (diff) | |
download | gcc-df16e146cf5355d7faeee0812206a0a688643de9.zip gcc-df16e146cf5355d7faeee0812206a0a688643de9.tar.gz gcc-df16e146cf5355d7faeee0812206a0a688643de9.tar.bz2 |
re PR c++/53096 ([DR 1333] [c++11] should be possible to default a copy ctor that takes non-const arg)
/cp
2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53096
* class.c (check_bases_and_members): Implement core/1333, do not
disallow defaulted in the class body non-const ref special members.
/testsuite
2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53096
* g++.dg/cpp0x/defaulted35.C: New.
* g++.dg/cpp0x/defaulted15.C: Adjust.
From-SVN: r186888
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/class.c | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 86e44fc..db8bf72 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2012-04-26 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/53096 + * class.c (check_bases_and_members): Implement core/1333, do not + disallow defaulted in the class body non-const ref special members. + 2012-04-24 Paolo Carlini <paolo.carlini@oracle.com> PR c++/52363 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 7b6559c..00aeefd 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -1,6 +1,7 @@ /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, + 2012 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) @@ -5144,9 +5145,6 @@ check_bases_and_members (tree t) give the synthesis error. */ error ("%q+D declared to take const reference, but implicit " "declaration would take non-const", fn); - else if (imp_const_p && !fn_const_p) - error ("%q+D declared to take non-const reference cannot be " - "defaulted in the class body", fn); } defaulted_late_check (fn); } |