[PATCH] D27277: Make _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR user-settable

2016-12-05 Thread Dimitry Andric via Phabricator via cfe-commits
dim abandoned this revision.
dim added a comment.

No, let's drop it. In the FreeBSD ports bug I have posted a patch to use 
`_LIBCPP_ABI_UNSTABLE ` instead, which appears to work fine. And at some point 
we'll update to `_LIBCPP_ABI_VERSION` 2, but not today. :)


https://reviews.llvm.org/D27277



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27277: Make _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR user-settable

2016-12-05 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added a comment.

@dim Do you still need this to fix the chromium bug?


https://reviews.llvm.org/D27277



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D27277: Make _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR user-settable

2016-11-30 Thread Dimitry Andric via Phabricator via cfe-commits
dim created this revision.
dim added reviewers: EricWF, emaste, mclow.lists, theraven.
dim added a subscriber: cfe-commits.

In https://reviews.llvm.org/rL275749 the old _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 
define was replaced
by _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR, which is also
auto-detected.

However, it is not overridable by the user, since you cannot use -U or
#undef to get rid of the define after __config was included, at least
not without gross hacks.

In the FreeBSD ports tree we have at least one libc++ consumer that
really needs to turn on the trivial constructor (chromium), see
https://bugs.freebsd.org/214654 for the details.  So I would like to
propose making _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
user-settable (to either zero, or nonzero).


https://reviews.llvm.org/D27277

Files:
  include/__config
  include/utility
  
test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
  test/libcxx/utilities/utility/pairs/pairs.pair/trivial_copy_move_ABI.pass.cpp
  test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp

Index: test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
===
--- test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
+++ test/std/utilities/utility/pairs/pairs.pair/trivial_copy_move.pass.cpp
@@ -32,23 +32,23 @@
 typedef std::pair P;
 {
 static_assert(std::is_copy_constructible::value, "");
-#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR == 0
 static_assert(std::is_trivially_copy_constructible::value, "");
 #endif
 }
 #if TEST_STD_VER >= 11
 {
 static_assert(std::is_move_constructible::value, "");
-#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR == 0
 static_assert(std::is_trivially_move_constructible::value, "");
 #endif
 }
 {
 using P1 = std::pair;
 static_assert(!std::is_copy_constructible::value, "");
 static_assert(!std::is_trivially_copy_constructible::value, "");
 static_assert(std::is_move_constructible::value, "");
-#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR == 0
 static_assert(std::is_trivially_move_constructible::value, "");
 #endif
 }
Index: test/libcxx/utilities/utility/pairs/pairs.pair/trivial_copy_move_ABI.pass.cpp
===
--- test/libcxx/utilities/utility/pairs/pairs.pair/trivial_copy_move_ABI.pass.cpp
+++ test/libcxx/utilities/utility/pairs/pairs.pair/trivial_copy_move_ABI.pass.cpp
@@ -29,7 +29,7 @@
 
 #include "test_macros.h"
 
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR != 0
 #error Non-trivial ctor ABI macro defined
 #endif
 
Index: test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
===
--- test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
+++ test/libcxx/utilities/utility/pairs/pairs.pair/non_trivial_copy_move_ABI.pass.cpp
@@ -21,16 +21,16 @@
 #undef _LIBCPP_ABI_UNSTABLE
 #undef _LIBCPP_ABI_VERSION
 #define _LIBCPP_ABI_VERSION 1
-#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR
+#define _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR 1
 
 #include 
 #include 
 #include 
 #include 
 
 #include "test_macros.h"
 
-#if !defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR == 0
 #error trivial ctor ABI macro defined
 #endif
 
Index: include/utility
===
--- include/utility
+++ include/utility
@@ -296,7 +296,7 @@
 constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
 #endif
 
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR != 0
 struct __non_trivially_copyable_base {
   _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
   __non_trivially_copyable_base() _NOEXCEPT {}
@@ -307,7 +307,7 @@
 
 template 
 struct _LIBCPP_TYPE_VIS_ONLY pair
-#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR)
+#if _LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR != 0
 : private __non_trivially_copyable_base
 #endif
 {
Index: include/__config
===
--- include/__config
+++ include/__config
@@ -51,9 +51,13 @@
 #elif _LIBCPP_ABI_VERSION == 1
 // Feature macros for disabling pre ABI v1 features. All of these options
 // are deprecated.
-#if defined(__FreeBSD__)
-#define