[cfe-commits] [PATCH] Add -fobjc-direct-class-refs

John McCall rjmccall at apple.com
Sat Aug 25 14:22:31 PDT 2012


On Aug 25, 2012, at 2:12 PM, Jonathan Schleifer wrote:
> Am 25.08.2012 um 23:10 schrieb John McCall:
>> Is there a particular reason why you don't want the exception models to interact correctly?  It's quite straightforward to make it work when you've designed things properly.
> 
> Yes, I don't really like a dependency on libstdc++. Plus I can't think of too many cases where it makes sense to throw in C++ and then catch in ObjC or vice versa. What's the advantage of using @catch instead of catch?

It's pretty useful to be able to catch an arbitrary exception from either language — for one, it's a hard requirement of @finally that a single personality can catch anything.  It also means that C++11's std::exception_ptr will correctly be able to shift your exceptions around between threads.  It's also what Clang happens to enforce, so you'll need to add a bunch of new checking if you don't want to do it. :)

You don't need to depend on the full libstdc++;  you can just rely on the ABI-level library (libsupc++ / libc++abi).

John.



More information about the cfe-commits mailing list