diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2012-01-27 00:12:41 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2012-01-27 00:12:41 +0000 |
commit | 6c1e7aa99cf4d918535ebfe59f19e48672a3c9a4 (patch) | |
tree | 70ae8a313c996c6f87189a828815f740e18f5732 /gcc/cp/error.c | |
parent | 2fda54bd153102ac40092ac4f38a7d885257de37 (diff) | |
download | gcc-6c1e7aa99cf4d918535ebfe59f19e48672a3c9a4.zip gcc-6c1e7aa99cf4d918535ebfe59f19e48672a3c9a4.tar.gz gcc-6c1e7aa99cf4d918535ebfe59f19e48672a3c9a4.tar.bz2 |
re PR c++/51370 (ICE with invalid template parameter)
/cp
2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51370
* error.c (dump_decl, [TEMPLATE_ID_EXPR]): Handle error_mark_node
as TREE_OPERAND (t, 1).
/testsuite
2012-01-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51370
* g++.dg/template/crash112.C: New.
From-SVN: r183593
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 62b47ca..09c6cae 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1,7 +1,7 @@ /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 + 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -1118,14 +1118,17 @@ dump_decl (tree t, int flags) case TEMPLATE_ID_EXPR: { tree name = TREE_OPERAND (t, 0); + tree args = TREE_OPERAND (t, 1); if (is_overloaded_fn (name)) name = DECL_NAME (get_first_fn (name)); dump_decl (name, flags); pp_cxx_begin_template_argument_list (cxx_pp); - if (TREE_OPERAND (t, 1)) - dump_template_argument_list (TREE_OPERAND (t, 1), flags); - pp_cxx_end_template_argument_list (cxx_pp); + if (args == error_mark_node) + pp_string (cxx_pp, M_("<template arguments error>")); + else if (args) + dump_template_argument_list (args, flags); + pp_cxx_end_template_argument_list (cxx_pp); } break; |