[cfe-dev] Using STD exceptions in Clang code

John McCall rjmccall at apple.com
Mon Aug 1 10:54:47 PDT 2011


On Aug 1, 2011, at 10:19 AM, Garrison Venn wrote:
> You may be affected by the fact that the clang libraries themselves (the ones 
> you are using), are built by default with exceptions disabled. If you are throwing
> "through" these libraries there would be an issue since cleanups would need to
> be invoked (internal to the clang libraries). If this is the case, you can always
> rebuild clang/llvm with exceptions on. Beyond a performance hit, I'm not sure
> what the stability issues would be when using clang/llvm built with exceptions
> enabled.

Mostly, it's that we don't write exceptions-safe code.  We do like
RAII, and you probably won't get memory leaks if you throw through
LLVM or clang code, but we've made absolutely no effort to support this.

John.



More information about the cfe-dev mailing list