public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marek Polacek <polacek@redhat.com>
To: Jason Merrill <jason@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: Failure to delay noexcept parsing with ptr-operator [PR100752]
Date: Thu, 10 Jun 2021 17:19:28 -0400	[thread overview]
Message-ID: <YMKB4MqqZ8uIRJF0@redhat.com> (raw)
In-Reply-To: <86ff3105-f6a0-8d9c-06f2-5c2b63c2efb9@redhat.com>

On Thu, Jun 10, 2021 at 03:09:29PM -0400, Jason Merrill wrote:
> On 6/8/21 8:25 PM, Marek Polacek wrote:
> > We weren't passing 'flags' to the recursive call to cp_parser_declarator
> > in the ptr-operator case and as an effect, delayed parsing of noexcept
> > didn't work as advertised.  The following change passes more than just
> > CP_PARSER_FLAGS_DELAY_NOEXCEPT but that doesn't seem to break anything.
> > 
> > I'm not passing member_p because I don't need it and because it breaks
> > a few tests.
> > 
> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches?
> > 
> > 	PR c++/100752
> > 
> > gcc/cp/ChangeLog:
> > 
> > 	* parser.c (cp_parser_declarator): Pass flags down to
> > 	cp_parser_declarator.
> > 
> > gcc/testsuite/ChangeLog:
> > 
> > 	* g++.dg/cpp0x/noexcept69.C: New test.
> > ---
> >   gcc/cp/parser.c                         |  3 +--
> >   gcc/testsuite/g++.dg/cpp0x/noexcept69.C | 12 ++++++++++++
> >   2 files changed, 13 insertions(+), 2 deletions(-)
> >   create mode 100644 gcc/testsuite/g++.dg/cpp0x/noexcept69.C
> > 
> > diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> > index d59a829d0b9..5930990ec1c 100644
> > --- a/gcc/cp/parser.c
> > +++ b/gcc/cp/parser.c
> > @@ -22066,8 +22066,7 @@ cp_parser_declarator (cp_parser* parser,
> >   	cp_parser_parse_tentatively (parser);
> >         /* Parse the dependent declarator.  */
> > -      declarator = cp_parser_declarator (parser, dcl_kind,
> > -					 CP_PARSER_FLAGS_NONE,
> > +      declarator = cp_parser_declarator (parser, dcl_kind, flags,
> >   					 /*ctor_dtor_or_conv_p=*/NULL,
> >   					 /*parenthesized_p=*/NULL,
> >   					 /*member_p=*/false,
> 
> Should the other parameters also be passed down?  I'd think definitely
> member_p and static_p, not sure about ctor_dtor_or_conv_p and
> parenthesized_p.

Hmm, as I mentioned in the patch description, I tried, but passing member_p
broke a few tests and since it's not needed for this fix I gave up
investigating why.  I could look into it if you're curious :).
 
Marek


  reply	other threads:[~2021-06-10 21:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09  0:25 Marek Polacek
2021-06-10 19:09 ` Jason Merrill
2021-06-10 21:19   ` Marek Polacek [this message]
2021-06-11  2:31     ` Jason Merrill
2021-06-25 20:42       ` [PATCH v2] " Marek Polacek
2021-06-25 20:47         ` 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=YMKB4MqqZ8uIRJF0@redhat.com \
    --to=polacek@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).