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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 44446385800F for ; Tue, 29 Jun 2021 22:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 44446385800F Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-173-u0D86YXWO1K7sG_gCjR7Vg-1; Tue, 29 Jun 2021 18:01:46 -0400 X-MC-Unique: u0D86YXWO1K7sG_gCjR7Vg-1 Received: by mail-qv1-f69.google.com with SMTP id ez18-20020ad459120000b029020e62abfcbdso2293qvb.16 for ; Tue, 29 Jun 2021 15:01:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RBHJfr7xyNLYFYpNqpZRnLgwXUG+YrmIX8knrVfVa/8=; b=qcXdEgcCulb6nlPb2b3VISOIWJUDyDTTR6q6Pt226JVwdqQ2ghIlBl/XA/do2LmSvW gccplxhI+C1gVLa+IJKEqW46BXD+ms5rGnFzxnMq5NPvkVWiDgXGsnnecJ1/Ukfav97+ XyH7nzEKqUzJuza33ydqO8dj/z/5j2EFgTLzNUA+RkzY7pHLSpFxhPFTWhUGtUP8LBBA kYkHjuRrQ4z+7/07AUld9ATkS/XUqPzfjlfY2rGjc+TfKGEhyTe1raSDr95bqw+NOlVa LVkSRxdGuu9yzmec+cBl8QUfCqXV0p9Iqxu7znbS7JoHkzeH+/Y0cdI/eaZMsBZPlRy0 hCxg== X-Gm-Message-State: AOAM530xg+y6aWMdTJGN9NtIGYfatezpsF9vmPLeJlotMK/vFZ03oQEm 4OEeG0Tp9VbYbkUK34TcxQnb+CVy03M9TJieMkWMmReVaZM0aYWgH7T7YYHG8nlnNGE2rAtl0b1 oC8Bs2nwvftrET9Iy8A== X-Received: by 2002:a37:4096:: with SMTP id n144mr32528676qka.271.1625004105789; Tue, 29 Jun 2021 15:01:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzsI5Cby63kJqFoHM47X6FFNM0U5CkdEfmFu+JL3MEyHAJGgFzW36tcdzASACzApu9ZPT7vuA== X-Received: by 2002:a37:4096:: with SMTP id n144mr32528665qka.271.1625004105603; Tue, 29 Jun 2021 15:01:45 -0700 (PDT) Received: from redhat.com ([2601:184:4780:4310::8e66]) by smtp.gmail.com with ESMTPSA id v5sm1312246qtp.25.2021.06.29.15.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 15:01:45 -0700 (PDT) Date: Tue, 29 Jun 2021 18:01:42 -0400 From: Marek Polacek To: Jason Merrill Cc: GCC Patches Subject: Re: [PATCH] c++: DR2397 - auto specifier for * and & to arrays [PR100975] Message-ID: References: <20210629192558.661420-1-polacek@redhat.com> <8b89494e-e5e5-ec7f-756d-5303bf3de5b6@redhat.com> MIME-Version: 1.0 In-Reply-To: <8b89494e-e5e5-ec7f-756d-5303bf3de5b6@redhat.com> 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=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 29 Jun 2021 22:01:49 -0000 On Tue, Jun 29, 2021 at 03:50:27PM -0400, Jason Merrill wrote: > On 6/29/21 3:25 PM, Marek Polacek wrote: > > --- a/gcc/testsuite/g++.dg/cpp0x/auto3.C > > +++ b/gcc/testsuite/g++.dg/cpp0x/auto3.C > > @@ -10,7 +10,7 @@ auto x; // { dg-error "auto" } > > auto i = 42, j = 42.0; // { dg-error "auto" } > > // New CWG issue > > Let's at least update this comment to quote [dcl.type.auto.deduct]/2: "T > shall not be an array type". I guess "unable to deduce" is a suitable > diagnostic for that error. Fixed. > > diff --git a/gcc/testsuite/g++.dg/diagnostic/auto1.C b/gcc/testsuite/g++.dg/diagnostic/auto1.C > > index ee2eefd59aa..9d9979e3fdc 100644 > > --- a/gcc/testsuite/g++.dg/diagnostic/auto1.C > > +++ b/gcc/testsuite/g++.dg/diagnostic/auto1.C > > @@ -1,4 +1,5 @@ > > // PR c++/86915 > > // { dg-do compile { target c++17 } } > > +// Allowed since DR2397. > > Well, not really; any attempt to use this template should hit the same > problem as above of trying to do auto deduction where T is an array type. > Please add to the testcase to get the error. Hmm, this template struct S { }; static int arr[1]; S s; won't give an error: I think it's because we coerce the auto tparm into 'auto*' before deducing and so don't get the type mismatch error. That seems to be in line with how 'template' works, though. So I think we don't need to change this in the patch. Do you agree? Marek