From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25955 invoked by alias); 6 Oct 2011 21:09:37 -0000 Received: (qmail 25905 invoked by uid 22791); 6 Oct 2011 21:09:36 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 21:09:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p96L9Ja0030029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 6 Oct 2011 17:09:19 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p96L9Gvt003529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 6 Oct 2011 17:09:18 -0400 Message-ID: <4E8E18FC.4030705@redhat.com> Date: Thu, 06 Oct 2011 21:09:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0 MIME-Version: 1.0 To: Tom Tromey CC: Abhijit Halder , gdb-patches@sourceware.org Subject: Re: [PATCH] [PR 9514] Fixing parse error for "pointer to a function pointer" References: <201109291210.01022.pedro@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00184.txt.bz2 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