[libcxx-commits] [libcxx] 318507e - [libc++] Remove a few unneeded _LIBCPP_CXX03_LANG ifdefs
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 16 15:14:59 PST 2022
Author: Nikolas Klauser
Date: 2022-02-17T00:14:42+01:00
New Revision: 318507edee14976e5ca696366b3a745b7b988aa0
URL: https://github.com/llvm/llvm-project/commit/318507edee14976e5ca696366b3a745b7b988aa0
DIFF: https://github.com/llvm/llvm-project/commit/318507edee14976e5ca696366b3a745b7b988aa0.diff
LOG: [libc++] Remove a few unneeded _LIBCPP_CXX03_LANG ifdefs
Reviewed By: Quuxplusone, ldionne, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D119896
Added:
Modified:
libcxx/include/__debug
libcxx/include/__iterator/reverse_access.h
libcxx/include/__memory/unique_ptr.h
libcxx/include/atomic
Removed:
################################################################################
diff --git a/libcxx/include/__debug b/libcxx/include/__debug
index 207591cd4058..b7677a22c859 100644
--- a/libcxx/include/__debug
+++ b/libcxx/include/__debug
@@ -45,15 +45,9 @@ struct _LIBCPP_TYPE_VIS __i_node
__i_node* __next_;
__c_node* __c_;
-#ifndef _LIBCPP_CXX03_LANG
__i_node(const __i_node&) = delete;
__i_node& operator=(const __i_node&) = delete;
-#else
-private:
- __i_node(const __i_node&);
- __i_node& operator=(const __i_node&);
-public:
-#endif
+
_LIBCPP_INLINE_VISIBILITY
__i_node(void* __i, __i_node* __next, __c_node* __c)
: __i_(__i), __next_(__next), __c_(__c) {}
@@ -68,15 +62,9 @@ struct _LIBCPP_TYPE_VIS __c_node
__i_node** end_;
__i_node** cap_;
-#ifndef _LIBCPP_CXX03_LANG
__c_node(const __c_node&) = delete;
__c_node& operator=(const __c_node&) = delete;
-#else
-private:
- __c_node(const __c_node&);
- __c_node& operator=(const __c_node&);
-public:
-#endif
+
_LIBCPP_INLINE_VISIBILITY
__c_node(void* __c, __c_node* __next)
: __c_(__c), __next_(__next), beg_(nullptr), end_(nullptr), cap_(nullptr) {}
@@ -155,15 +143,9 @@ class _LIBCPP_TYPE_VIS __libcpp_db
__libcpp_db();
public:
-#ifndef _LIBCPP_CXX03_LANG
__libcpp_db(const __libcpp_db&) = delete;
__libcpp_db& operator=(const __libcpp_db&) = delete;
-#else
-private:
- __libcpp_db(const __libcpp_db&);
- __libcpp_db& operator=(const __libcpp_db&);
-public:
-#endif
+
~__libcpp_db();
class __db_c_iterator;
diff --git a/libcxx/include/__iterator/reverse_access.h b/libcxx/include/__iterator/reverse_access.h
index 931ff582323d..40c266378d36 100644
--- a/libcxx/include/__iterator/reverse_access.h
+++ b/libcxx/include/__iterator/reverse_access.h
@@ -21,8 +21,6 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-#if !defined(_LIBCPP_CXX03_LANG)
-
#if _LIBCPP_STD_VER > 11
template <class _Tp, size_t _Np>
@@ -95,9 +93,7 @@ auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c))
return _VSTD::rend(__c);
}
-#endif
-
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif // _LIBCPP_STD_VER > 11
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__memory/unique_ptr.h b/libcxx/include/__memory/unique_ptr.h
index 8b330508511a..348c90325e6f 100644
--- a/libcxx/include/__memory/unique_ptr.h
+++ b/libcxx/include/__memory/unique_ptr.h
@@ -263,7 +263,6 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr {
unique_ptr& operator=(unique_ptr const&) = delete;
#endif
-
_LIBCPP_INLINE_VISIBILITY
~unique_ptr() { reset(); }
@@ -485,7 +484,6 @@ class _LIBCPP_UNIQUE_PTR_TRIVIAL_ABI _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
unique_ptr(unique_ptr const&) = delete;
unique_ptr& operator=(unique_ptr const&) = delete;
#endif
-
public:
_LIBCPP_INLINE_VISIBILITY
~unique_ptr() { reset(); }
diff --git a/libcxx/include/atomic b/libcxx/include/atomic
index 7fed8713e03a..4a5c4847dabd 100644
--- a/libcxx/include/atomic
+++ b/libcxx/include/atomic
@@ -1651,13 +1651,7 @@ struct __atomic_base // false
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
__atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
-#ifndef _LIBCPP_CXX03_LANG
__atomic_base(const __atomic_base&) = delete;
-#else
-private:
- _LIBCPP_INLINE_VISIBILITY
- __atomic_base(const __atomic_base&);
-#endif
};
#if defined(__cpp_lib_atomic_is_always_lock_free)
@@ -2439,19 +2433,10 @@ typedef struct atomic_flag
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {} // EXTENSION
-#ifndef _LIBCPP_CXX03_LANG
atomic_flag(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) = delete;
atomic_flag& operator=(const atomic_flag&) volatile = delete;
-#else
-private:
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag(const atomic_flag&);
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag& operator=(const atomic_flag&);
- _LIBCPP_INLINE_VISIBILITY
- atomic_flag& operator=(const atomic_flag&) volatile;
-#endif
+
} atomic_flag;
More information about the libcxx-commits
mailing list