This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH for c++/53733 (DR 1402, deleting move ctor)
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Cc: Paolo Carlini <paolo dot carlini at oracle dot com>
- Date: Fri, 13 Jul 2012 16:59:07 +0200
- Subject: Re: C++ PATCH for c++/53733 (DR 1402, deleting move ctor)
- References: <4FFB71A5.3070800@redhat.com>
On 07/10/2012 02:04 AM, Jason Merrill wrote:
Apparently we need to implement DR 1402 in 4.7 in order to fix the
std::pair ABI breakage properly. So here it is: if overload resolution
chooses a non-trivial copy constructor, instead of causing the move
constructor to be deleted, we just don't implicitly declare it.
Tested x86_64-pc-linux-gnu, applying to trunk and 4.7.
PR 53953 points out a regression caused by this patch; I didn't notice
that the lambda code returns before I had initialized no_implicit_p.
Tested x86_64-pc-linux-gnu, applying to trunk and 4.7.
commit ceef07db024219e8a2694aceb59cd2ddc4ce9d6f
Author: Jason Merrill <jason@redhat.com>
Date: Fri Jul 13 16:47:38 2012 +0200
PR c++/53953
* method.c (synthesized_method_walk): Initialize no_implicit_p sooner.
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index bd0792f..b0e9ece 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -1120,6 +1120,9 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (spec_p)
*spec_p = (cxx_dialect >= cxx0x ? noexcept_true_spec : empty_except_spec);
+ if (no_implicit_p)
+ *no_implicit_p = false;
+
if (deleted_p)
{
/* "The closure type associated with a lambda-expression has a deleted
@@ -1195,9 +1198,6 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p,
if (trivial_p)
*trivial_p = expected_trivial;
- if (no_implicit_p)
- *no_implicit_p = false;
-
/* The TYPE_HAS_COMPLEX_* flags tell us about constraints from base
class versions and other properties of the type. But a subobject
class can be trivially copyable and yet have overload resolution