This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR c++/29475: Incomplete template diagnostics
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Simon Martin <simartin at users dot sourceforge dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 04 Dec 2006 20:50:35 -0800
- Subject: Re: [PATCH] Fix PR c++/29475: Incomplete template diagnostics
- References: <200611051954.04753.simartin@users.sourceforge.net> <200611130802.19033.simartin@users.sourceforge.net> <45594CA3.30206@codesourcery.com> <200612012057.53804.simartin@users.sourceforge.net>
Simon Martin wrote:
> Hello Mark.
>
> On Tuesday 14 November 2006 05:57, you wrote:
>> [...]
>>> I am willing to try to change the "storage" of the deferred checks from a
>>> TREE_LIST to a VEC.
>> Thanks!
> As promised, here's a patch that changes the way deferred access checks are
> stored: one uses a VEC of a new 'struct deferred_access_check' instead of a
> tree list. It is rather straight-forward except for the parser.c bits...
Thanks for working on this!
The path looks pretty good. A tiny nit:
+ /* A VECTOR representing name-lookups for which we have deferred
Say either "A vector" or "A VEC", since the name of the type is "VEC",
not "VECTOR".
Unfortunately, I think the token hash thing is too ugly. We could just
add a field to cp_token for deferred_access_checks. That's actually a
more natural representation, as, then, the value of
CPP_NESTED_NAME_SPECIFIER is its scope, and the deferred checks are just
on the side. But, then, we would have an extra field per token, which
could be quite significant. So, even better would be to make
cp_token::value into:
union {
/* Used for all other tokens. */
tree value;
/* Used for CPP_NESTED_NAME_SPECIFIER and CPP_TEMPLATE_ID. */
tree_check value;
} u;
with:
struct tree_check {
tree value;
VEC (deferred_access_checks) *checks;
};
If you're brave enough to do that, that would be great. If you've had
enough, just add the extra field to cp_token; that's still good
progress, in that we've eliminated the evil TREE_LIST, and fixed the
inconsistency in error messages between deferred/non-deferred checks.
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713