<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 4:17 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word">Thanks.  Unfortunately that's one of the ways we figured it out :(.<div><br></div><div>The status quo, before this commit, was an ABI difference between Objective-C++ (-fobjc-arc) and C++/Objective-C++ (-fno-objc-arc), which is... really bad.  But rare enough I guess it took a couple of years to find.</div><div><br></div><div>I suspect/hope the break from this commit will be even more rare in practice, since it's somewhat odd to vend Objective-C++ APIs.  Usually the (Objective-)C++ parts are implementation details beneath a pure Objective-C API, and if you recompile one TU you'll recompile the rest.<br><div><br></div><div>Since you brought up the ABI difference... there's still at least one lurking: C++98/C++03 vs. C++11 are ABI-incompatible for things like std::cv_status.  I'm not sure how (or whether we should bother) to fix that; it's a little strange that we expose strong enums to pre-C++11 at all.</div></div></div></blockquote><div><br></div><div>Libc++ exposes almost all of the C++11 library pre-C++11, so that's why cv_status has a C++03 compatible definitions. And Unfortunatly using unscoped enumerations as a fallback won't work, even though they would be ABI compatible.</div><div><br></div><div>The much more egregious C++03 vs C++11 ABI incompatibility is `nullptr`. In C++03 libc++ emulates nullptr_t using a class type and then #define's nullptr. This is obviously ABI incompatible with C++11s version.</div><div>Thankfully Clang provides an alternative keyword, __nullptr, in C++03, which I've used to implement a fix in ABI v2 or by defining _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR.</div><div><br></div><div>If Apple is concerned about these sorts of ABI incompatibilities you should consider cherry picking _LIBCPP_ABI_ALWAYS_USE_CXX11_NULLPTR in the next release.</div><div><br></div><div>/Eric</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><div><div class="gmail-h5"><div><br><div><blockquote type="cite"><div>On Mar 31, 2017, at 13:37, Eric Fiselier <<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>> wrote:</div><br class="gmail-m_5933865649224824437Apple-interchange-newline"><div><div dir="ltr">This will be ABI breaking for Objective-C++ users. I'm not objecting to fixing the bogus configuration, but I just wanted to point it out.<div><br></div><div>/Eric</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 31, 2017 at 11:39 AM, Duncan P. N. Exon Smith via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Author: dexonsmith<br>
Date: Fri Mar 31 12:39:56 2017<br>
New Revision: 299236<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=299236&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=299236&view=rev</a><br>
Log:<br>
Use strong enums independently of -fobjc-arc<br>
<br>
r145698 introduced _LIBCPP_HAS_NO_STRONG_ENUMS by copy-pasting the<br>
__has_feature check from objc_arc_weak/_LIBCPP_HAS_OBJC<wbr>_ARC_WEAK, and<br>
accidentally started defining _LIBCPP_HAS_NO_STRONG_ENUMS whenever<br>
__has_feature(objc_arc_weak).  This is totally bogus, and means that<br>
Libc++ thinks Objective-C++ compilations with -fobjc-arc don't have<br>
strong enums.<br>
<br>
Delete the accidental line.<br>
<br>
I thought about adding a test, but it would be entirely duplicative of<br>
the patch (if has-feature strong enums, check that has-no-strong-enums<br>
is not defined).<br>
<br>
Modified:<br>
    libcxx/trunk/include/__config<br>
<br>
Modified: libcxx/trunk/include/__config<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=299236&r1=299235&r2=299236&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject/libcxx/trunk/include/__<wbr>config?rev=299236&r1=299235&r2<wbr>=299236&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- libcxx/trunk/include/__config (original)<br>
+++ libcxx/trunk/include/__config Fri Mar 31 12:39:56 2017<br>
@@ -348,7 +348,6 @@ typedef __char32_t char32_t;<br>
<br>
 #if __has_feature(objc_arc_weak)<br>
 #define _LIBCPP_HAS_OBJC_ARC_WEAK<br>
-#define _LIBCPP_HAS_NO_STRONG_ENUMS<br>
 #endif<br>
<br>
 #if !(__has_feature(cxx_constexpr)<wbr>)<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</div></blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div>