Bug 1256136 - Enable std::is_destructible with clang/libc++ again. r?dougt draft
authorJan Beich <jbeich@FreeBSD.org>
Sun, 13 Mar 2016 13:05:00 +0000
changeset 339849 14fbd0832db39f3d27950acec2a2f8b1f9aea849
parent 339848 13e8c5082ff3f1803e2eb4a75819c485ed9a4c19
child 516055 25061bf9cac572c83d57b0e02d2bc11245f096ab
push id12807
push userjbeich@FreeBSD.org
push dateSun, 13 Mar 2016 13:06:16 +0000
reviewersdougt
bugs1256136
milestone48.0a1
Bug 1256136 - Enable std::is_destructible with clang/libc++ again. r?dougt MozReview-Commit-ID: 5oPV1GVnhbn
xpcom/glue/nsISupportsImpl.h
--- a/xpcom/glue/nsISupportsImpl.h
+++ b/xpcom/glue/nsISupportsImpl.h
@@ -27,21 +27,21 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/Compiler.h"
 #include "mozilla/Likely.h"
 #include "mozilla/MacroArgs.h"
 #include "mozilla/MacroForEach.h"
 #include "mozilla/TypeTraits.h"
 
 #if defined(__clang__)
-   // bug 1028428 shows that at least in FreeBSD 10.0 with Clang 3.4 and libc++ 3.4,
-   // std::is_destructible is buggy in that it returns false when it should return true
-   // on ipc::SharedMemory. On the other hand, all Clang versions currently in use
-   // seem to handle the fallback just fine.
-#  define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
+#  if MOZ_USING_LIBCXX && __has_include(<type_traits>)
+#    define MOZ_HAVE_STD_IS_DESTRUCTIBLE
+#  else
+#    define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
+#  endif
 #elif defined(__GNUC__)
    // GCC 4.7 is has buggy std::is_destructible
 #  if MOZ_USING_LIBSTDCXX && MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
 #    define MOZ_HAVE_STD_IS_DESTRUCTIBLE
    // Some GCC versions have an ICE when using destructors in decltype().
    // Works on GCC 4.8 at least.
 #  elif MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
 #    define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK