This is the mail archive of the 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 C++ PRs 28736, 28737 and 28738

On 8/21/06, Mark Mitchell <> wrote:
we should instead arrange that the entry in the parameter list is not
error_mark_node, but a TREE_LIST node with an error_mark as its
TREE_VALUE?  It seems like we're running into problems because we've
introduced a typing violation; we expect these vectors to contain
TREE_LISTs, and now they sometimes contain an unvarnished error_mark_node.

The attached patch attempts to implement this suggestion, I hope that I've gone about this the right way. One added bonus of this approach is that it fixes all three PRs in one go although a few existing testcases needed to have their dg-error markers tweaked to allow them to pass.

There is one small change which I'm not too sure about and that is the
patch to comp_template_parms. For the sake of error recovery, this now
treats template parameter lists which contains an invalid parameter as
equal. This fixes an ICE which arose after the initial changes were in
place where one of the parameter lists being passed in had an invalid
parameter, this caused comp_template_parms to return 0 and trigger and
triggered the following gcc_assert in check_classfn:

gcc_assert (!template_parms
		  || comp_template_parms (template_parms,
					  DECL_TEMPLATE_PARMS (function)));

Patch has been bootstrapped and regression tested on i686-pc-linux-gnu.



2006-08-26 Lee Millward <>

       PR c++/28736
       PR c++/28737
       PR c++/28738
       * pt.c (process_template_parm): Store invalid template
       parameters as a TREE_LIST with a TREE_VALUE of error_mark_node.
       (push_inline_template_parms_recursive): Check for template
       parameters having a TREE_VALUE of error_mark_node rather than
       check the parameter itself.
       (mangle_class_name_for_template): Likewise.
       (comp_template_parms): When comparing the individual template
       parameters, return 1 if either is error_mark_node.
       (current_template_args): Robustify.
       (redeclare_class_template): Likewise.


2006-08-26 Lee Millward <>

       PR c++/28736
       * g++.dg/template/void10.C: New test.

       PR c++/28737
       * g++.dg/template/void8.C: New test.

       PR c+_+/28738
       * g++.dg/template/void9.C: New test.

       * g++.dg/template/void3.C: Adjust error markers.
       * g++.dg/template/void4.C: Likewise.
       * g++.dg/template/crash55.C: Likewise.
       * g++.dg/template/void7.C: Likewise.

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