This is the mail archive of the
mailing list for the GCC project.
Re: C++ PATCH to cp_parser_postfix_expression
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Chris Faylor <cgf at redhat dot com>, Mark Mitchell<mark at codesourcery dot com>
- Date: Thu, 13 Feb 2003 12:36:16 +0000
- Subject: Re: C++ PATCH to cp_parser_postfix_expression
- Organization: Codesourcery LLC
- References: <firstname.lastname@example.org>
Jason Merrill wrote:
We were failing to set idk to CP_PARSER_ID_KIND_QUALIFIED for the case of a
name qualified with both object and scope. As a result, we were
incorrectly doing virtual lookup for some function calls.
Fixes g++.dg/overload/virtual1.C, a regression from 3.3.
Tested i686-pc-linux-gnu. Mark, does this look like the right fix?
2003-02-12 Jason Merrill <email@example.com>
* parser.c (cp_parser_postfix_expression): Set idk properly for
This is PR 9485. I looked at that, and whilst a patch like yours fixes the
bug, it occurred to me that something along the lines of getting
cp_parser_postfix_expression to return an idk value might be better. I wrote
something about it to Mark:
PR 9485 turns out to be a new parser bug. I've had a look, and am in
two minds about how to fix it. The basic problem is that
we forget that A::fn was a qualified name, and therefore do a LOOKUP_NORMAL
rather than LOOKUP_NONVIRTUAL in build_new_method call.
The CPP_DEREF case in cp_parser_postfix_expression is the culprit here.
It doesn't set idk at all. Now, setting idk changes its meaning slightly
because the postfix expression isn't an identifier, but I think that's
livable with. idk is currently set by cp_parser_primary_expression and not
My thoughts are to have cp_parser_id_expression set a *idk parameter,
therefore removing code from cp_parser_primary_expression. I think the
template_p pointer arg of cp_parser_id_expression can go away too, and
you'd have to expand the CP_PARSER_ID_KIND enumaration to a set of
I suspect that got lost.
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
The voices in my head said this was stupid too
firstname.lastname@example.org : http://www.cs.bris.ac.uk/~nathan/ : email@example.com