Commit 3a2419a7 by Volker Reichelt Committed by Volker Reichelt

re PR c++/28250 (ICE with invalid catch)

	PR c++/28250
	* pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to
	valid decls.  Cleanup.

	* g++.dg/eh/catch3.C: New test.

From-SVN: r115643
parent e488a090
2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28250
* pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to
valid decls. Cleanup.
PR c++/28363 PR c++/28363
* semantics.c (check_template_template_default_arg): Simplify * semantics.c (check_template_template_default_arg): Simplify
error handling. error handling.
......
...@@ -8491,20 +8491,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) ...@@ -8491,20 +8491,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case HANDLER: case HANDLER:
{ {
tree decl; tree decl = HANDLER_PARMS (t);
stmt = begin_handler (); if (decl)
if (HANDLER_PARMS (t))
{ {
decl = HANDLER_PARMS (t);
decl = tsubst (decl, args, complain, in_decl); decl = tsubst (decl, args, complain, in_decl);
/* Prevent instantiate_decl from trying to instantiate /* Prevent instantiate_decl from trying to instantiate
this variable. We've already done all that needs to be this variable. We've already done all that needs to be
done. */ done. */
DECL_TEMPLATE_INSTANTIATED (decl) = 1; if (decl != error_mark_node)
DECL_TEMPLATE_INSTANTIATED (decl) = 1;
} }
else stmt = begin_handler ();
decl = NULL_TREE;
finish_handler_parms (decl, stmt); finish_handler_parms (decl, stmt);
tsubst_expr (HANDLER_BODY (t), args, complain, in_decl); tsubst_expr (HANDLER_BODY (t), args, complain, in_decl);
finish_handler (stmt); finish_handler (stmt);
......
2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28250
* g++.dg/eh/catch3.C: New test.
PR c++/28363 PR c++/28363
* g++.dg/template/defarg10.C: New test. * g++.dg/template/defarg10.C: New test.
// PR c++/28250
// { dg-do compile }
template<int> void foo()
{
try {}
catch () {} // { dg-error "type-specifier" }
}
template void foo<0>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment