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.129.124]) by sourceware.org (Postfix) with ESMTPS id 2979C3858D32 for ; Tue, 29 Nov 2022 22:05:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2979C3858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669759544; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=qZTHk1YTl6eWdHjIobBTDQkdie2Sfbx4aTAqLVxwvUI=; b=cxB8/xsq0WZMR+b6603njf1FnLq6HM2m56vFB9ECBSFncUvgw+0JcVDO3yML08uxj+f8Fx 3d9cZ/z34WfPzvY4lDYVBTIhqo1WF2u4s+Xcjk6WJrt9cD2nGXbIgNNYLYyQkLAm629SGT 6gEU4qp6R5aigwYP+DZa3lMPzFuI13I= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-613-Ktotqi7RP9CwqTw33v0Osg-1; Tue, 29 Nov 2022 17:05:38 -0500 X-MC-Unique: Ktotqi7RP9CwqTw33v0Osg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C5A93C0F661 for ; Tue, 29 Nov 2022 22:05:37 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59E962028DC1; Tue, 29 Nov 2022 22:05:37 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2ATM5W8m4191016 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 29 Nov 2022 23:05:33 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2ATM5VIq4191015; Tue, 29 Nov 2022 23:05:31 +0100 Date: Tue, 29 Nov 2022 23:05:31 +0100 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: Incremental fix for g++.dg/gomp/for-21.C [PR84469] Message-ID: Reply-To: Jakub Jelinek References: <029221ef-74ce-12a4-29f9-599bf4efaa20@redhat.com> MIME-Version: 1.0 In-Reply-To: <029221ef-74ce-12a4-29f9-599bf4efaa20@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 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=-3.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Nov 29, 2022 at 04:38:50PM -0500, Jason Merrill wrote: > > --- gcc/testsuite/g++.dg/gomp/for-21.C.jj 2020-01-12 11:54:37.178401867 +0100 > > +++ gcc/testsuite/g++.dg/gomp/for-21.C 2022-11-29 13:06:59.038410557 +0100 > > @@ -54,9 +54,9 @@ void > > f6 (S (&a)[10]) > > { > > #pragma omp for collapse (2) > > - for (auto [i, j, k] : a) // { dg-error "use of 'i' before deduction of 'auto'" "" { target *-*-* } .-1 } > > + for (auto [i, j, k] : a) // { dg-error "use of 'i' before deduction of 'auto'" } > > for (int l = i; l < j; l += k) // { dg-error "use of 'j' before deduction of 'auto'" } > > - ; // { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-3 } > > + ; // { dg-error "use of 'k' before deduction of 'auto'" "" { target *-*-* } .-1 } > > Hmm, this error is surprising: since the initializer is non-dependent, we > should have deduced immediately. I'd expect the same error as in the > non-structured-binding cases, "* expression refers to iteration variable". The reason was just to be consistent what is (unfortunately) emitted in the other cases (!processing_template_decl or type dependent). I guess I could try how much work would it be to deduce it sooner, but generally it is pretty corner case, people rarely do this in OpenMP code. Jakub