From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33357 invoked by alias); 18 May 2018 15:55:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33344 invoked by uid 89); 18 May 2018 15:55:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=HX-Google-DKIM-Signature:RYp, our X-HELO: mail-ot0-f178.google.com Received: from mail-ot0-f178.google.com (HELO mail-ot0-f178.google.com) (74.125.82.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 18 May 2018 15:55:38 +0000 Received: by mail-ot0-f178.google.com with SMTP id l13-v6so9637562otk.9 for ; Fri, 18 May 2018 08:55:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KbdGclV9qOXvn8Zb5zbs9/RYp+BT4ewYeUPkxksJFfY=; b=q9MBsQmmnUcftkA24FQM2ZxCScZtPwG9xiA4pf/gVVsl0bBVR2zqfLuLBZklRLDOBc d0BhTj4mE1PTE8/ggnmYUlrBJ8uP/ZXHCoC/5JETNHLatBZBEm9ezQ3CbhZYdhyRjxNc x5AFPsl4qF2dzU1Gjx/0Yg8hPobFY5+JKPod/Sq6TtmjbpVmgjkvlIil6WLPEXnMaI1k 4pLqlSDSQPPSzOwnjL2OtN1GcrvbMqu9Ev4q3euDy3gN6bNynMosHoWDOkHDTxHG0mi7 UpQnvQyaiY84zIMzlOC4og+PbjW7qVvKtRULpUwQoIp9k3E8Gqqx0mVcstw2RTHZeYqG 8QZQ== X-Gm-Message-State: ALKqPweOPWs8Gff5OuoCHFUkrpvJk21z/oG2h0Esov84n3dJ1nqOcnCt 7uIQCXIj2p5kc7aK6dNJCrNzUB9eO3ug2nVA9NTSmg== X-Google-Smtp-Source: AB8JxZpoXc2vGvwkNcLEkuE9ll5Ll5DQmakqGkv0JzvWWDGvGEKjVoKYCdMo2oHQbgrN/7GzDsTvaAkT5szVYDIGPXA= X-Received: by 2002:a9d:b75:: with SMTP id p50-v6mr6418130otd.277.1526658936532; Fri, 18 May 2018 08:55:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.201.13.229 with HTTP; Fri, 18 May 2018 08:55:16 -0700 (PDT) In-Reply-To: <20180518145113.GQ7974@redhat.com> References: <20180518145113.GQ7974@redhat.com> From: Jason Merrill Date: Fri, 18 May 2018 15:59:00 -0000 Message-ID: Subject: Re: RFC (libstdc++): C++ PATCH for c++/58407, C++11 deprecation of implicit copy To: Jonathan Wakely Cc: gcc-patches List Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-05/txt/msg00934.txt.bz2 On Fri, May 18, 2018 at 10:51 AM, Jonathan Wakely wrote: > On 18/05/18 10:29 -0400, Jason Merrill wrote: >> >> The second patch is some libstdc++ changes to avoid warnings from uses >> of the standard library when this warning is on. More are almost >> certainly needed. Jonathan, how would you like me to handle this WRT >> the library? Check in both patches and let you follow up as needed? > > > Yes, please go ahead and commit the library patch, we'll deal with the > rest as needed (I'll give myself a TODO to test with -Wdeprecated-copy > and fix what I find). > > I'm not sure we need the "Avoid implicit deprecation" comments. Adding > defaulted definitions is good style anyway, so needs no justification. > I'll make sure nobody removes them again in the name of cleaning up > unnecessary noise (which they aren't). OK. > Did you change your mind about leaving the exception hierarchy without > the defaulted ops, to get warnings for slicing? Yes, because the warning also triggers in cases where we know the dynamic type of the object, such as exception e; throw e; I think a slicing warning should be separate. Also because these functions are required by the standard, as below. > I've just realised that our user-declared destructors on the exception > classes (which exist so we can control where the key function is > emitted) mean they have no implicit move ops. But the standard implies > they should have implicitly-declared move ops (because it doesn't > declare any special members for those classes). I'll open a bug. Hmm, looks to me like it declares special members. 21.8.2 Class exception [exception] namespace std { class exception { public: exception() noexcept; exception(const exception&) noexcept; exception& operator=(const exception&) noexcept; virtual ~exception(); virtual const char* what() const noexcept; }; } Jason