[patch] Diagnose invalid destructor name in friend declarations

Mark Mitchell mark@codesourcery.com
Fri Dec 23 22:47:00 GMT 2005


Volker Reichelt wrote:

> Ok. There's a little problem, however: check_dtor_name expects a
> BIT_NOT_EXPR as second argument:
> 
>   /* Returns nonzero iff the destructor name specified in NAME
>      (a BIT_NOT_EXPR) matches BASETYPE.  The operand of NAME can take many
>      forms...  */
> 
>   bool
>   check_dtor_name (tree basetype, tree name)
>   {
>     name = TREE_OPERAND (name, 0);
> 
> I could rearrange the code in cp_parser_unqualified_id to build a
> BIT_NOT_EXPR first, but I'd rather get rid of the line
>     name = TREE_OPERAND (name, 0);
> at the top of check_dtor_name.

Your way's better.  Pre-approved.  Thanks!

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list