diff options
| author | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-21 09:59:57 +0000 |
|---|---|---|
| committer | reichelt <reichelt@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-21 09:59:57 +0000 |
| commit | e25a65a121ea0b6be5b0089984988cd7bbe3b7be (patch) | |
| tree | 47257e935ca7afc4d653d7031859c5a3c8667774 | |
| parent | d312e151ab9e743ef0a7f8ef849947650a0c553a (diff) | |
| download | ppe42-gcc-e25a65a121ea0b6be5b0089984988cd7bbe3b7be.tar.gz ppe42-gcc-e25a65a121ea0b6be5b0089984988cd7bbe3b7be.zip | |
PR c++/28250
* pt.c (tsubst_expr): Only apply DECL_TEMPLATE_INSTANTIATED to
valid decls. Cleanup.
* g++.dg/eh/catch3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115643 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/cp/pt.c | 12 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/eh/catch3.C | 10 |
4 files changed, 22 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 722334c1777..0017e1d8b40 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f65d0ce25a6..76deddd04ae 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8491,20 +8491,18 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl) 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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d56ce67b233..ad43ecab79f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2006-07-21 Volker Reichelt <reichelt@igpm.rwth-aachen.de> + PR c++/28250 + * g++.dg/eh/catch3.C: New test. + PR c++/28363 * g++.dg/template/defarg10.C: New test. diff --git a/gcc/testsuite/g++.dg/eh/catch3.C b/gcc/testsuite/g++.dg/eh/catch3.C new file mode 100644 index 00000000000..884829288e4 --- /dev/null +++ b/gcc/testsuite/g++.dg/eh/catch3.C @@ -0,0 +1,10 @@ +// PR c++/28250 +// { dg-do compile } + +template<int> void foo() +{ + try {} + catch () {} // { dg-error "type-specifier" } +} + +template void foo<0>(); |

