summaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorLee Millward <lee.millward@codesourcery.com>2006-07-28 17:01:19 +0000
committerLee Millward <lmillward@gcc.gnu.org>2006-07-28 17:01:19 +0000
commit42b304f1ce846092056b7daa32c6288e285420fa (patch)
treeb9d1ed85681b7f931fd356b2dec21c008026518e /gcc/cp/error.c
parent8f2cc5b59bd35f2cac909fbe84cb6093be3121e5 (diff)
downloadgcc-42b304f1ce846092056b7daa32c6288e285420fa.tar.gz
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
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c10
1 files changed, 8 insertions, 2 deletions
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)
{