This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] [PR 9514] Fixing parse error for "pointer to a function pointer"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]