From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id AE30B3857C62 for ; Fri, 1 Oct 2021 20:14:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AE30B3857C62 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-400-8ZoVfYXHPKWj5hgDa2rhVw-1; Fri, 01 Oct 2021 16:14:13 -0400 X-MC-Unique: 8ZoVfYXHPKWj5hgDa2rhVw-1 Received: by mail-qk1-f197.google.com with SMTP id s18-20020a05620a255200b00433885d4fa7so17920248qko.4 for ; Fri, 01 Oct 2021 13:14:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OoBSt1Bz1L8TT+nx43iJlkND7lMk/x0BkazkPMDvqlw=; b=wk2AnCROIr5Xz2EhLyoKpK83+xcXqqBl5Kailt3Q4f5V7Y9FdtTeByFxIDvwc/viTl rUgzIu0BohGI3qWsOY5RdPNwCpNCIB0fqD6bOeY/cNOwvNHu5Vkb+PV5bnF5dAMDNEhQ BBS7Z5AjtceFkOdloPpfwWMRBa6jcKMUaAkfAAPMbG5QRcIosfjyvaw4Z+GXGJsg611U xSLdr8EMsy/edI+n6XoKBW9D2fno1DSuXLETcGIHxXwXIgNFnE49ZG7Tmnb8QZf2xnEr C6Hr2XZ1APAkYy1i7AYhAmKMrk+T8trccX/lmGU1Ol5tlJ4nilRFVeW7ZQTleqKcMhgR IOzQ== X-Gm-Message-State: AOAM530cxW/Xoku3VzkDmBOlbHjpIT68FhzGgmeuIxidr4pBPWL8KT6V NPMzF5DZb22hPWkyfqIDX6Rul7uM7hPa1PGvNsCvAVI5GcSdvVEF0GULN19SQMA6CBwJqWVxda6 VnDP93RFHUT0ZU9d+Tg== X-Received: by 2002:ac8:4c8d:: with SMTP id j13mr14811717qtv.155.1633119252317; Fri, 01 Oct 2021 13:14:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5VI3IOlJvMbAWOcq7+FcFDYf+SyhIurnP9YZI/xjExMxFQ3dkP+9Z3XfWjf3XeFk5QaQyXA== X-Received: by 2002:ac8:4c8d:: with SMTP id j13mr14811696qtv.155.1633119252117; Fri, 01 Oct 2021 13:14:12 -0700 (PDT) Received: from redhat.com ([2601:184:4780:4310::9b82]) by smtp.gmail.com with ESMTPSA id q14sm4191682qtw.82.2021.10.01.13.14.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 13:14:11 -0700 (PDT) Date: Fri, 1 Oct 2021 16:14:09 -0400 From: Marek Polacek To: Jason Merrill Cc: GCC Patches Subject: Re: [PATCH] c++: Implement C++20 -Wdeprecated-array-compare [PR97573] Message-ID: References: <20210930145031.23104-1-polacek@redhat.com> <7962e5b5-9e10-60f8-9a4e-26e86040a542@redhat.com> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/2.0.7 (2021-05-04) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 20:14:17 -0000 On Fri, Oct 01, 2021 at 09:30:41AM -0400, Jason Merrill wrote: > On 9/30/21 17:56, Marek Polacek wrote: > > On Thu, Sep 30, 2021 at 03:34:24PM -0400, Jason Merrill wrote: > > > On 9/30/21 10:50, Marek Polacek wrote: > > > > This patch addresses one of my leftovers from GCC 11. C++20 introduced > > > > [depr.array.comp]: > > > > "Equality and relational comparisons between two operands of array type are > > > > deprecated." > > > > so this patch adds -Wdeprecated-array-compare (enabled by default in C++20). > > > > > > Why not enable it by default in all modes? It was always pretty dubious > > > code. > > > > Sure, it could be done, but it kind of complicates things: we'd probably > > need a different option and a different message because it seems incorrect > > to say "deprecated" in e.g. C++17 when this was only deprecated in C++20. > > The warning could say "deprecated in C++20", which is always true? > > > I'd rather not add another option; if it stays -Wdeprecated-array-compare > > but -Wno-deprecated doesn't turn it off that also seems weird. > > > > I could rename it to -Warray-compare, enable by -Wall, and only > > append "is deprecated" to the warning message in C++20. Does that seem > > better? > > That sounds fine too. I did this so that I can add the warning to the C FE too. Please take a look at if you get the chance, thanks. So consider this patch discarded. I wonder what I could do so that Patchwork marks it as such, too. Marek