From 42b304f1ce846092056b7daa32c6288e285420fa Mon Sep 17 00:00:00 2001 From: Lee Millward Date: Fri, 28 Jul 2006 17:01:19 +0000 Subject: re PR c++/27668 (ICE with invalid template parameter) PR c++/27668 PR c++/27962 * pt.c (process_template_parm) Store invalid template parameters as error_mark_node in the paramater list. (push_inline_template_parms_recursive): Handle invalid template parameters. (comp_template_parms): Likewise. (check_default_tmpl_arg): Likewise. (coerce_template_template_parms): Likewise. (mangle_class_name_for_template): Likewise. (tsubst_template_parms): Likewise. * error.c (dump_template_argument_list): Likewise. * g++.dg/template/crash55.C: New test. * g++.dg/template/nontype16.C: New test. * g++.dg/template/void2.C: Adjust error markers. * g++.dg/template/nontype5.C: Adjust error markers. From-SVN: r115800 --- gcc/cp/error.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gcc/cp/error.c') diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 91a73cca4fc..d6c813da7a7 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -166,8 +166,14 @@ dump_template_argument_list (tree args, int flags) static void dump_template_parameter (tree parm, int flags) { - tree p = TREE_VALUE (parm); - tree a = TREE_PURPOSE (parm); + tree p; + tree a; + + if (parm == error_mark_node) + return; + + p = TREE_VALUE (parm); + a = TREE_PURPOSE (parm); if (TREE_CODE (p) == TYPE_DECL) { -- cgit v1.2.1