From 2d8ba2c76b324d0a4328520a825160034cfb8fff Mon Sep 17 00:00:00 2001 From: Lee Millward Date: Wed, 9 Aug 2006 18:43:06 +0000 Subject: [PATCH] re PR c++/28637 (ICE on invalid template parameter) 2006-08-09 Lee Millward PR c++/28637 * pt.c (coerce_template_parms): Copy across the invalid template arguments to the new template inner arguments. (retrieve_specialization): Robustify. * g++.dg/template/void3.C: New test. PR c++/28638 * pt.c (coerce_template_template_parms): Robustify. * g++.dg/template/void4.C: New test. PR c++/28639 * error.c (dump_template_parms): Robustify. PR c++/28640 * pt.c (redeclare_class_template): Robustify * g++.dg/template/void5.C: New test. PR c++/28641 * pt.c (type_unification_real): Robustify. From-SVN: r116043 --- gcc/cp/ChangeLog | 19 +++++++++++++++ gcc/cp/error.c | 10 +++++++- gcc/cp/pt.c | 33 ++++++++++++++++++++++----- gcc/testsuite/ChangeLog | 11 +++++++++ gcc/testsuite/g++.dg/template/void3.C | 5 ++++ gcc/testsuite/g++.dg/template/void4.C | 7 ++++++ gcc/testsuite/g++.dg/template/void5.C | 5 ++++ 7 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/void3.C create mode 100644 gcc/testsuite/g++.dg/template/void4.C create mode 100644 gcc/testsuite/g++.dg/template/void5.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1f05b730aa8..1106f86b0c7 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,22 @@ +2006-08-09 Lee Millward + + PR c++/28637 + * pt.c (coerce_template_parms): Copy across the + invalid template arguments to the new template inner arguments. + (retrieve_specialization): Robustify. + + PR c++/28638 + * pt.c (coerce_template_template_parms): Robustify. + + PR c++/28639 + * error.c (dump_template_parms): Robustify. + + PR c++/28640 + * pt.c (redeclare_class_template): Robustify. + + PR c++/28641 + * pt.c (type_unification_real): Robustify. + 2006-08-03 Lee Millward PR c++/28347 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d6c813da7a7..f87355893cb 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1242,7 +1242,15 @@ dump_template_parms (tree info, int primary, int flags) for (ix = 0; ix != len; ix++) { - tree parm = TREE_VALUE (TREE_VEC_ELT (parms, ix)); + tree parm; + + if (TREE_VEC_ELT (parms, ix) == error_mark_node) + { + pp_identifier (cxx_pp, "