This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: C++ PATCH: rethrow from cdtor function try block


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]