This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] Fix PR c++/29475: Incomplete template diagnostics


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


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