[libc++] Remove _LIBCPP_DEFAULT
authorNikolas Klauser <nikolasklauser@berlin.de>
Tue, 7 Dec 2021 19:29:35 +0000 (20:29 +0100)
committerNikolas Klauser <nikolasklauser@berlin.de>
Tue, 7 Dec 2021 21:18:38 +0000 (22:18 +0100)
clang has `= default` as an extension in c++03, so just use it.

Reviewed By: ldionne, Quuxplusone, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D115275

libcxx/include/__config
libcxx/include/__memory/allocator.h
libcxx/include/atomic
libcxx/include/system_error

index da03e87..84ce728 100644 (file)
@@ -837,12 +837,6 @@ typedef unsigned int   char32_t;
 #define _LIBCPP_HAS_NO_RANGES
 #endif
 
-#ifdef _LIBCPP_CXX03_LANG
-#  define _LIBCPP_DEFAULT {}
-#else
-#  define _LIBCPP_DEFAULT = default;
-#endif
-
 #ifdef __GNUC__
 #  define _LIBCPP_NOALIAS __attribute__((__malloc__))
 #else
index 283212f..708bd82 100644 (file)
@@ -89,7 +89,7 @@ public:
     typedef true_type   is_always_equal;
 
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-    allocator() _NOEXCEPT _LIBCPP_DEFAULT
+    allocator() _NOEXCEPT = default;
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
@@ -171,7 +171,7 @@ public:
     typedef true_type   is_always_equal;
 
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-    allocator() _NOEXCEPT _LIBCPP_DEFAULT
+    allocator() _NOEXCEPT = default;
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
index cfd0e1d..4b4c347 100644 (file)
@@ -1443,7 +1443,7 @@ struct __cxx_atomic_impl : public _Base {
     static_assert(is_trivially_copyable<_Tp>::value,
       "std::atomic<T> requires that 'T' be a trivially copyable type");
 
-  _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT _LIBCPP_DEFAULT
+  _LIBCPP_INLINE_VISIBILITY __cxx_atomic_impl() _NOEXCEPT = default;
   _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR explicit __cxx_atomic_impl(_Tp value) _NOEXCEPT
     : _Base(value) {}
 };
@@ -1644,7 +1644,7 @@ struct __atomic_base  // false
     __atomic_base() noexcept(is_nothrow_default_constructible_v<_Tp>) : __a_(_Tp()) {}
 #else
     _LIBCPP_INLINE_VISIBILITY
-    __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
+    __atomic_base() _NOEXCEPT = default;
 #endif
 
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
@@ -1673,7 +1673,7 @@ struct __atomic_base<_Tp, true>
     typedef __atomic_base<_Tp, false> __base;
 
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-    __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
+    __atomic_base() _NOEXCEPT = default;
 
     _LIBCPP_INLINE_VISIBILITY
     _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
@@ -1762,7 +1762,7 @@ struct atomic
     atomic() = default;
 #else
     _LIBCPP_INLINE_VISIBILITY
-    atomic() _NOEXCEPT _LIBCPP_DEFAULT
+    atomic() _NOEXCEPT = default;
 #endif
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1790,7 +1790,7 @@ struct atomic<_Tp*>
     typedef ptrdiff_t difference_type;
 
     _LIBCPP_INLINE_VISIBILITY
-    atomic() _NOEXCEPT _LIBCPP_DEFAULT
+    atomic() _NOEXCEPT = default;
 
     _LIBCPP_INLINE_VISIBILITY
     _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}
@@ -2432,7 +2432,7 @@ typedef struct atomic_flag
     atomic_flag() _NOEXCEPT : __a_(false) {}
 #else
     _LIBCPP_INLINE_VISIBILITY
-    atomic_flag() _NOEXCEPT _LIBCPP_DEFAULT
+    atomic_flag() _NOEXCEPT = default;
 #endif
 
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
index 3aa869a..0bd2d23 100644 (file)
@@ -206,7 +206,7 @@ public:
     error_category() _NOEXCEPT;
 #else
     _LIBCPP_INLINE_VISIBILITY
-    _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT
+    _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT = default;
 #endif
 private:
     error_category(const error_category&);// = delete;