Commit 9f6206d9 by Volker Reichelt Committed by Volker Reichelt

re PR c++/23191 (ICE on invalid throw in template)

	PR c++/23191
	* pt.c (tsubst) <case METHOD_TYPE>: Check for error_mark_node
	before calling build_exception_variant.

	* g++.dg/template/eh2.C: New test.

From-SVN: r102819
parent bf2f7328
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23191
* pt.c (tsubst) <case METHOD_TYPE>: Check for error_mark_node
before calling build_exception_variant.
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/19498 PR c++/19498
* pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE * pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE
if substitution of template args did not succeed. if substitution of template args did not succeed.
......
...@@ -7336,6 +7336,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl) ...@@ -7336,6 +7336,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* Substitute the exception specification. */ /* Substitute the exception specification. */
specs = tsubst_exception_specification (t, args, complain, specs = tsubst_exception_specification (t, args, complain,
in_decl); in_decl);
if (specs == error_mark_node)
return error_mark_node;
if (specs) if (specs)
fntype = build_exception_variant (fntype, specs); fntype = build_exception_variant (fntype, specs);
return fntype; return fntype;
......
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23191
* g++.dg/template/eh2.C: New test.
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/19498 PR c++/19498
* g++.dg/template/instantiate7.C: New test. * g++.dg/template/instantiate7.C: New test.
......
// PR c++/23191
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do compile }
template<typename T> struct A
{
void foo() throw(typename T::X); // { dg-error "not a class" }
};
A<void> a; // { dg-error "instantiated" }
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