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
* semantics.c (check_template_template_default_arg): Simplify
error handling.
case HANDLER:
{
- tree decl;
+ tree decl = HANDLER_PARMS (t);
- stmt = begin_handler ();
- if (HANDLER_PARMS (t))
+ if (decl)
{
- decl = HANDLER_PARMS (t);
decl = tsubst (decl, args, complain, in_decl);
/* Prevent instantiate_decl from trying to instantiate
this variable. We've already done all that needs to be
done. */
- DECL_TEMPLATE_INSTANTIATED (decl) = 1;
+ if (decl != error_mark_node)
+ DECL_TEMPLATE_INSTANTIATED (decl) = 1;
}
- else
- decl = NULL_TREE;
+ stmt = begin_handler ();
finish_handler_parms (decl, stmt);
tsubst_expr (HANDLER_BODY (t), args, complain, in_decl);
finish_handler (stmt);