Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Abhijit Halder <abhijit.k.halder@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [PR 9514] Fixing parse error for "pointer to a function pointer"
Date: Thu, 06 Oct 2011 21:09:00 -0000	[thread overview]
Message-ID: <4E8E18FC.4030705@redhat.com> (raw)
In-Reply-To: <m339fauipv.fsf@fleche.redhat.com>

On 10/03/2011 09:45 AM, Tom Tromey wrote:
> Also, please look at my earlier patch for this bug.  I think it shows
> some cases that your patch does not address:
>
>      http://sourceware.org/ml/gdb-patches/2008-08/msg00539.html
>
> Perhaps I ought to simply commit that patch.  I am not sure why I never
> have.  What do you think?

I've looked over both of these patches. Abhijit's original patch is much 
simpler, but there are still regressions using it w/CVS HEAD:

+FAIL: gdb.base/code-expr.exp: (int ** @code)
+FAIL: gdb.base/cvexpr.exp: (int ** const)

I think Tom's approach is more generic, however more (marginally) 
complicated, but it, too, suffers from some problems. Most specifically, 
the ptr_operator production conflicts with the conversion operator 
production. Consider "ptype &foo::operator char* (void)" from 
cplusfuncs.exp.

We end up in the "OPERATOR ptype" production, but because of the new 
ptr_operator rules, this is parsed as OPERATOR, nonempty_typelist, 
func_mod instead of OPERATOR, nonempty_typelist, '(', nonempty_typelist, ')'

So we end up with "operator char (*" with Tom's patch. I keep thinking 
there must be a way to force the parser through the OPERATOR ptype 
production and then the TYPE_INSTANCE production, but I have not been 
successful. More savvy bison-ers might be able to do it, though. Or 
maybe I'll dedicate some time to this and figure it out.

Maybe some crafty massaging of these three productions will yield a 
"simpler" answer.

Keith


  reply	other threads:[~2011-10-06 21:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 10:44 Abhijit Halder
2011-09-29 10:51 ` Abhijit Halder
2011-09-29 11:13   ` Pedro Alves
2011-09-29 11:49     ` Abhijit Halder
2011-10-03 16:46       ` Tom Tromey
2011-10-06 21:09         ` Keith Seitz [this message]
2011-10-17 11:16           ` Abhijit Halder
2011-10-18 20:14             ` Keith Seitz
2011-10-18 20:51               ` Tom Tromey

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=4E8E18FC.4030705@redhat.com \
    --to=keiths@redhat.com \
    --cc=abhijit.k.halder@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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