[cfe-commits] r70256 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp test/SemaCXX/exceptions.cpp www/cxx_status.html

Chris Lattner clattner at apple.com
Tue May 12 23:45:44 PDT 2009


On Apr 27, 2009, at 11:25 PM, Sebastian Redl wrote:

>
> On Mon, 27 Apr 2009 15:10:30 -0700, Chris Lattner <clattner at apple.com>
> wrote:
>> On Apr 27, 2009, at 2:33 PM, Sebastian Redl wrote:
>>
>>> Author: cornedbee
>>> Date: Mon Apr 27 16:33:24 2009
>>> New Revision: 70256
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=70256&view=rev
>>> Log:
>>> Track down return statements in the handlers of a function-try-block
>>> of constructors. Meh ...
>>
>> Hi Sebastian,
>>
>> Instead of doing this as a treewalk, how about handling this in sema
>> of a return.  Just check to see if the context is a construction
>> function whose body is a try block there?
>
> I've thought about this. However, this would mean either an additional
> state variable in Sema (and it would have to be saved for members of  
> local
> classes), or a non-trivial query for every return statement.
> Function-try-blocks are so rare in real-world code that I think my  
> way is
> better.

How is this query non-trivial?  Isn't it just a context check?

-Chris



More information about the cfe-commits mailing list