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
This commit is contained in:
Volker Reichelt 2005-08-06 22:38:44 +00:00 committed by Volker Reichelt
parent bf2f7328ff
commit 9f6206d9df
4 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -7336,6 +7336,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
/* Substitute the exception specification. */
specs = tsubst_exception_specification (t, args, complain,
in_decl);
if (specs == error_mark_node)
return error_mark_node;
if (specs)
fntype = build_exception_variant (fntype, specs);
return fntype;

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,10 @@
// 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" }