From 2d46ec8394a92a61ce70f4d9893596343b7ba118 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 27 Apr 2001 13:33:46 +0000 Subject: [PATCH] except.c (can_convert_eh): Don't check template parms, typename types etc. cp: * except.c (can_convert_eh): Don't check template parms, typename types etc. testsuite: * g++.old-deja/g++.eh/crash6.C: New test. From-SVN: r41628 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/except.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.old-deja/g++.eh/crash6.C | 26 ++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.eh/crash6.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7e49e69..fa97ff8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2001-04-27 Nathan Sidwell + * except.c (can_convert_eh): Don't check template parms, + typename types etc. + +2001-04-27 Nathan Sidwell + * optimize.c (maybe_clone_body): Copy parameter names and locations. 2001-04-27 Nathan Sidwell diff --git a/gcc/cp/except.c b/gcc/cp/except.c index c68ea40..0a50138 100644 --- a/gcc/cp/except.c +++ b/gcc/cp/except.c @@ -821,7 +821,7 @@ can_convert_eh (to, from) /* else fall through */ } - if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from) + if (CLASS_TYPE_P (to) && CLASS_TYPE_P (from) && PUBLICLY_UNIQUELY_DERIVED_P (to, from)) return 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d04c26c..00b94a0 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2001-04-27 Nathan Sidwell + * g++.old-deja/g++.eh/crash6.C: New test. + +2001-04-27 Nathan Sidwell + * g++.old-deja/g++.other/warn7.C: New test. 2001-04-27 Nathan Sidwell diff --git a/gcc/testsuite/g++.old-deja/g++.eh/crash6.C b/gcc/testsuite/g++.old-deja/g++.eh/crash6.C new file mode 100644 index 0000000..1f5dcce --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.eh/crash6.C @@ -0,0 +1,26 @@ +// Build don't link: +// +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 26 April 2001 +// Origin: schmid@snake.iap.physik.tu-darmstadt.de + +// Bug 2368. When checking shadowed catchers, we didn't ignore +// template type parms etc, leading to an ICE + +template +void call(int& a) +{ + try + { + + } + catch (CatchType1&) + { + + } + catch (CatchType2&) + { + + } +} + -- 2.7.4