public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: Incremental fix for g++.dg/gomp/for-21.C [PR84469]
Date: Tue, 29 Nov 2022 23:05:31 +0100	[thread overview]
Message-ID: <Y4aCK+GpGBYP7vwS@tucnak> (raw)
In-Reply-To: <029221ef-74ce-12a4-29f9-599bf4efaa20@redhat.com>

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


  reply	other threads:[~2022-11-29 22:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 12:32 Jakub Jelinek
2022-11-29 21:38 ` Jason Merrill
2022-11-29 22:05   ` Jakub Jelinek [this message]
2022-11-30 15:51     ` Jakub Jelinek
2022-11-30 18:52       ` Jason Merrill
2022-12-01 10:32         ` [PATCH] c++, v2: " Jakub Jelinek
2022-12-01 18:21           ` Jason Merrill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4aCK+GpGBYP7vwS@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).