From: Volker Reichelt Date: Sat, 6 Aug 2005 22:38:44 +0000 (+0000) Subject: re PR c++/23191 (ICE on invalid throw in template) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f6206d9df6963318e5bf2ea6ddc5c747f46ff37;p=gcc.git re PR c++/23191 (ICE on invalid throw in template) PR c++/23191 * pt.c (tsubst) : Check for error_mark_node before calling build_exception_variant. * g++.dg/template/eh2.C: New test. From-SVN: r102819 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5593ef6f383..6220be681e6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2005-08-06 Volker Reichelt + + PR c++/23191 + * pt.c (tsubst) : Check for error_mark_node + before calling build_exception_variant. + 2005-08-06 Volker Reichelt PR c++/19498 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index bd95372478f..cabda6cbf9e 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 690dbf41c20..5ed686f8dd8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-08-06 Volker Reichelt + + PR c++/23191 + * g++.dg/template/eh2.C: New test. + 2005-08-06 Volker Reichelt PR c++/19498 diff --git a/gcc/testsuite/g++.dg/template/eh2.C b/gcc/testsuite/g++.dg/template/eh2.C new file mode 100644 index 00000000000..8ec767d3933 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/eh2.C @@ -0,0 +1,10 @@ +// PR c++/23191 +// Origin: Volker Reichelt +// { dg-do compile } + +template struct A +{ + void foo() throw(typename T::X); // { dg-error "not a class" } +}; + +A a; // { dg-error "instantiated" }