diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-05 23:32:13 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-05 23:32:13 -0500 |
commit | 11f18e1dafa5d79dba18bc10523deb6307b201c4 (patch) | |
tree | 7961fa1b392efb3a2803ad33f2c7e0aa30cb3dd9 /gcc/cp | |
parent | 040ca4b38fd75538442804d77b96f27df21fbd8f (diff) | |
download | gcc-11f18e1dafa5d79dba18bc10523deb6307b201c4.zip gcc-11f18e1dafa5d79dba18bc10523deb6307b201c4.tar.gz gcc-11f18e1dafa5d79dba18bc10523deb6307b201c4.tar.bz2 |
re PR c++/34180 (Default copy constructor copies const auto_ptr members)
PR c++/34180
* method.c (do_build_copy_constructor): Don't drop cv-quals from
the field type.
From-SVN: r153960
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/method.c | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 98cca71..e909ba2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2009-11-05 Jason Merrill <jason@redhat.com> + PR c++/34180 + * method.c (do_build_copy_constructor): Don't drop cv-quals from + the field type. + PR c++/7046 * class.c (finish_struct): Store maximum_field_alignment in TYPE_PRECISION. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index f13d99d..47f9e42 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -622,6 +622,7 @@ do_build_copy_constructor (tree fndecl) if (DECL_MUTABLE_P (field)) quals &= ~TYPE_QUAL_CONST; + quals |= TYPE_QUALS (expr_type); expr_type = cp_build_qualified_type (expr_type, quals); } |