aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/except.c
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2006-07-17 04:42:24 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2006-07-17 04:42:24 +0000
commit2a50edcd0f5cca974fe82b27a1b109618afa1a05 (patch)
tree215431855ee45679fe617055909a44fafef8e7f9 /gcc/cp/except.c
parent23be7a669151a833b7ab99a657082ce72a9ae3fd (diff)
downloadgcc-2a50edcd0f5cca974fe82b27a1b109618afa1a05.zip
gcc-2a50edcd0f5cca974fe82b27a1b109618afa1a05.tar.gz
gcc-2a50edcd0f5cca974fe82b27a1b109618afa1a05.tar.bz2
re PR c++/28250 (ICE with invalid catch)
PR c++/28250 * name-lookup.c (pushdecl_maybe_friend): Return early on error_mark_node. * except.c (expand_start_catch_block): Use error_mark_node instead of NULL_TREE for invalid decls. * parser.c (cp_parser_exception_declaration): Return error_mark_node on invalid catch parameter. Simplify. * g++.dg/eh/catch1.C: New test. * g++.dg/eh/catch2.C: New test. From-SVN: r115516
Diffstat (limited to 'gcc/cp/except.c')
-rw-r--r--gcc/cp/except.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index a02fc2f..17166d9 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -412,7 +412,7 @@ expand_start_catch_block (tree decl)
/* Make sure this declaration is reasonable. */
if (decl && !complete_ptr_ref_or_void_ptr_p (TREE_TYPE (decl), NULL_TREE))
- decl = NULL_TREE;
+ decl = error_mark_node;
if (decl)
type = prepare_eh_type (TREE_TYPE (decl));
@@ -438,7 +438,7 @@ expand_start_catch_block (tree decl)
/* If there's no decl at all, then all we need to do is make sure
to tell the runtime that we've begun handling the exception. */
- if (decl == NULL)
+ if (decl == NULL || decl == error_mark_node)
finish_expr_stmt (do_begin_catch ());
/* If the C++ object needs constructing, we need to do that before