This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: rethrow from cdtor function try block
- To: nathan at cs dot bris dot ac dot uk
- Subject: Re: C++ PATCH: rethrow from cdtor function try block
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 4 May 1999 10:41:08 -0700
- CC: egcs-patches at egcs dot cygnus dot com
- References: <372F1CF0.4B50C4EA@acm.org>
- Reply-to: mark at codesourcery dot com
>>>>> "Nathan" == Nathan Sidwell <nathan@acm.org> writes:
Nathan> I keep a static local variable in parse.y, which is 1
Nathan> inside a cdtor's function-try-block catcher. Outside it is
Nathan> zero, and inside a nested try block it is greater than
Nathan> 1. At the end of a handler, I emit a rethrow, if this flag
Nathan> is 1. This logic will fail, if there is a local class
Nathan> inside a cdtor's function-try-block catcher which contains
Nathan> member functions with try blocks. I find it hard to
Nathan> imagine why such a situation would be useful.
None-the-less, these incompleteness problems in g++ are exactly what
has made it so hard to maintain. Your patch may be an improvement in
that it reduces the number of cases which fail, but will make the
compiler harder to maintain, especially given that when we want to fix
this bug we may well have to rearchitect the logic you are adding.
We need to find a better way. One possibility, which I am
championing, is a brand-new parser, providing opportunities for
everything from the return-value optimization, to inlining on trees,
to fixing the kinds of issues you mention here. The only obstacle
is a lack of funding.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com