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:
parent
bf2f7328ff
commit
9f6206d9df
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
10
gcc/testsuite/g++.dg/template/eh2.C
Normal file
10
gcc/testsuite/g++.dg/template/eh2.C
Normal 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" }
|
Loading…
Reference in New Issue
Block a user