This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Fix 2368
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH] Fix 2368
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Fri, 27 Apr 2001 14:35:36 +0100
- Organization: Codesourcery LLC
Hi,
I've installed this obvious patch on both mainline and branch
which fixes 2.95 regression 2368.
We try and warn about shadowed catchers, but should only do so on
real classes, not things which might be classes (like template types).
built & tested on i686-pc-linux-gnu.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-04-26 Nathan Sidwell <nathan@codesourcery.com>
* except.c (can_convert_eh): Don't check template parms,
typename types etc.
Index: cp/except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/except.c,v
retrieving revision 1.129
diff -c -3 -p -r1.129 except.c
*** except.c 2001/04/22 23:50:06 1.129
--- except.c 2001/04/26 15:36:18
*************** can_convert_eh (to, from)
*** 821,827 ****
/* else fall through */
}
! if (IS_AGGR_TYPE (to) && IS_AGGR_TYPE (from)
&& PUBLICLY_UNIQUELY_DERIVED_P (to, from))
return 1;
--- 821,827 ----
/* else fall through */
}
! if (CLASS_TYPE_P (to) && CLASS_TYPE_P (from)
&& PUBLICLY_UNIQUELY_DERIVED_P (to, from))
return 1;
// Build don't link:
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 26 April 2001 <nathan@codesourcery.com>
// 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<class CatchType1, class CatchType2>
void call(int& a)
{
try
{
}
catch (CatchType1&)
{
}
catch (CatchType2&)
{
}
}