[patch] Fix PR c++/28051

Mark Mitchell mark@codesourcery.com
Wed Jun 21 19:02:00 GMT 2006


Lee Millward wrote:

> 2006-06-18  Lee Millward  <lee.millward@gmail.com>
> 
>     PR c++/28051
>     * pt.c (tsubst_copy): Check for tsubst
>     returning error_mark_node before calling
>     mangle_conv_op_name_for_type.

I would prefer that mangle_conv_op_name_for_type do the check.  In
general, if functions check their arguments, we end up with fewer
checks: one check per function, rather than per call-site.  The obvious
change to move this check to mangle_conv_op_name is pre-approved.

Please be careful with coding standards:

> +          if(new_type == error_mark_node)

Here, you need a space between "if" and "(".  That problem occurs in
several places.

>     * name-lookup.c (push_class_level_binding): Robustify.

OK.

>     (do_class_using_decl): Likewise.

Let's bail earlier.  If name is erroneous, we're in danger of blowing up
here:

  name_dependent_p = (scope_dependent_p
                      || (IDENTIFIER_TYPENAME_P (name)
                          && dependent_type_p (TREE_TYPE (name))));

which is above the code you changed.  Let's just check "name ==
error_mark_node" on entry to the function, and return NULL_TREE.

That change is pre-approved.

Thanks,

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



More information about the Gcc-patches mailing list