<div dir="ltr">So far as I can tell, __EXCEPTIONS behaves as documented: it is defined if Clang will emit exceptional destructor cleanups. How it is defined on Darwin vs. Linux vs. Obj-C++ is all based on crazy different platform defaults that I can't untangle. It sounds like Obj-C++ on Mac enables Obj-C exceptions by default, which means we keep around C++ destructor cleanups, so __EXCEPTIONS is defined.<div><br></div><div>In all cases, the __has_feature(cxx_exceptions) test will indicate if 'try' and 'throw' are available.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 3:30 AM, RenĂ© J. V. Bertin via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">David Chisnall via cfe-dev wrote:<br>
<br>
<br>
> but it is not defined for Objective-C++ or C++ when exceptions are<br>
> enabled by default.<br>
<br>
</span>That seems like yet something else, but how can this be an Apple bug (it happens<br>
with Ubuntu builds from <a href="http://llvm.org" rel="noreferrer" target="_blank">llvm.org</a> too when targetting Darwin)? What's more, how<br>
can it be a bug if it's documented and explained?<br>
<br>
I can imagine why __EXCEPTIONS would be set if any kind of exceptions are<br>
enabled; it's only for history reasons one might expect that token to be C++-<br>
specific (cf. the -fcxx-exceptions argument; I haven't yet checked if -<br>
fexceptions actually controls both C++ and ObjC exceptions).<br>
<span class=""><br>
> This bug is also present in clang 4.0, but only with a<br>
> macos target (e.g. x86_64-apple-macos), but not with an ios target.<br>
<br>
</span>The lack of consistency certainly seems to be a bug.<br>
<div class="HOEnZb"><div class="h5"><br>
______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div>