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]

[patch] Fix C++ PRs 27670, 27493, 27494 and 27397


Hi,

The attached patch is a slight update to one I was working on a while
ago which was originally intended for PRs 27493 and 27494 but after
some additional testing on similiar testcases from Bugzilla I've found
that it actually fixes the all four of the PRs mentioned in the
subject line.

All of these bugs are caused by discarding invalid template parameters
and not adding them to the parameter list. Later on this mismatch
between the number of declared parameters in the program and the
number stored in the parameter list by the front-end caused ICE's by
trying to access out-of-bound parameters.

The fix for these bugs follows on from the fix for PR 27668 by storing
rejected template parameters from cp_parser_template_parameter (which
returns error_mark_node in this situation) to the parameter list
inside a TREE_LIST with it's TREE_VALUE set to error_mark_node.

Bootstrapped and regression tested with no new failures on
i686-pc-linux-gnu, ok for mainline?

Cheers,
Lee.

cp/
2006-08-30  Lee Millward  <lee.millward@codesourcery.com>

       PR c++/27670
       PR c++/27493
       PR c++/27494
       PR c++/27397
       * parser.c (cp_parser_template_parameter_list): Add
       invalid template parameters to the parameter list as
       error_mark_node.

testsuite/
2006-08-30  Lee Millward  <lee.millward@codesourcery.com>

       PR c+/27670
       * g++.dg/template/operator9.C: New test.

       PR c++/27493
       * g++.dg/template/operator7.C: New test.

       PR c++/27494
       * g++.dg/template/operator8.C: New test.

       PR c++/27397
       * g++.dg/template/crash56.C: New test.

       * g++.dg/template/typedef4.C: Adjust error markers.
       * g++.dg/template/typedef5.C: Likewise.

Attachment: patch.txt
Description: Text document


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