From patchwork Tue Jul 10 00:04:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 169985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id CD95B2C0088 for ; Tue, 10 Jul 2012 10:05:31 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1342483533; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=wxZwvfw UYAWktAAYMs50gL5p2Cs=; b=eeKf3RxAghbT9mjiMsxSu8rzfqcSE1pTKM9beKs M078Wa1bLYTQSq/jenIusRFXYFiBYAQlY4etFKfRAC7ssOgUZpXZykGqi0Rs9qQ3 8cFPLAexp9k1+DTorbbS8dbkEe0VEfZyAnEtkRLbN/XPBh36CayR7YANg7SJQGqg JOaM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CcrpxfANZi1TLp8ZMw+rsWr/vEButPnLy9nsYfU+dem/ZO+cCiJMCQQ7lzm3ou oEBEi6kttutpHY0XMHHsdMQL7Czv50ZMZWd51Fstqc/W+y5MWZ0U5Mx4xjbHBkMW o5Pv5g7wDgVyphyL09z556PK+50c/X49yTtEBpQMpLtTQ=; Received: (qmail 10265 invoked by alias); 10 Jul 2012 00:05:16 -0000 Received: (qmail 10243 invoked by uid 22791); 10 Jul 2012 00:05:12 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, SPF_HELO_PASS, TW_SF, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 10 Jul 2012 00:04:55 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6A04tBo004989 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 9 Jul 2012 20:04:55 -0400 Received: from [10.3.113.112] (ovpn-113-112.phx2.redhat.com [10.3.113.112]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6A04rUv022153; Mon, 9 Jul 2012 20:04:54 -0400 Message-ID: <4FFB71A5.3070800@redhat.com> Date: Tue, 10 Jul 2012 02:04:53 +0200 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120605 Thunderbird/13.0 MIME-Version: 1.0 To: gcc-patches List CC: Paolo Carlini Subject: C++ PATCH for c++/53733 (DR 1402, deleting move ctor) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. While I was looking at this, I noticed that my earlier fix to handling of cleanups vs. ctor exception specifications was incomplete, so I've fixed that too. commit d0334cc0204e8bff2aada54b8f9c73fdc3ebcd50 Author: Jason Merrill Date: Tue Jul 10 01:42:02 2012 +0200 * method.c (synthesized_method_walk): Avoid changing EH spec based on cleanups in other places, too. diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 0237456..7ea2de9 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -1315,7 +1315,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, { rval = locate_fn_flags (base_binfo, complete_dtor_identifier, NULL_TREE, flags, complain); - process_subob_fn (rval, false, spec_p, NULL, + process_subob_fn (rval, false, NULL, NULL, deleted_p, NULL, NULL, basetype); } @@ -1335,7 +1335,7 @@ synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, if (ctor_p) walk_field_subobs (TYPE_FIELDS (ctype), complete_dtor_identifier, sfk_destructor, TYPE_UNQUALIFIED, false, - false, false, spec_p, NULL, + false, false, NULL, NULL, deleted_p, NULL, NULL, flags, complain); diff --git a/gcc/testsuite/g++.dg/cpp0x/implicit13.C b/gcc/testsuite/g++.dg/cpp0x/implicit13.C index 96bc770..3165863 100644 --- a/gcc/testsuite/g++.dg/cpp0x/implicit13.C +++ b/gcc/testsuite/g++.dg/cpp0x/implicit13.C @@ -14,7 +14,7 @@ struct B: A { }; // { dg-final { scan-assembler-not "_ZN1BC1Ev" } } B b; -struct C { C() noexcept; ~C(); }; +struct C { C() noexcept; ~C() noexcept(false); }; struct D: C { }; extern D d; @@ -22,3 +22,11 @@ void *operator new(__SIZE_TYPE__, void*) noexcept; #define SA(X) static_assert((X),#X) SA(noexcept(new (&d) D)); + +struct E: virtual C { }; +extern E e; +SA(noexcept (new (&e) E)); + +struct F { C c; }; +extern F f; +SA(noexcept (new (&f) F));