-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc++] Deprecated shared_ptr
Atomic Access APIs as per P0718R2 & Implemented P2869R3: Remove Deprecated shared_ptr
Atomic Access APIs from C++26
#87111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ With the latest revision this PR passed the C/C++ code formatter. |
@llvm/pr-subscribers-libcxx Author: Hristo Hristov (H-G-Hristov) ChangesImplements https://wg21.link/P2869R3 Full diff: https://github.com/llvm/llvm-project/pull/87111.diff 15 Files Affected:
diff --git a/libcxx/docs/ReleaseNotes/19.rst b/libcxx/docs/ReleaseNotes/19.rst
index dd39c1bbbc78a3..577560b490e838 100644
--- a/libcxx/docs/ReleaseNotes/19.rst
+++ b/libcxx/docs/ReleaseNotes/19.rst
@@ -42,6 +42,7 @@ Implemented Papers
- P2652R2 - Disallow User Specialization of ``allocator_traits``
- P2819R2 - Add ``tuple`` protocol to ``complex``
- P2495R3 - Interfacing ``stringstream``\s with ``string_view``
+- P2869R3 - Remove Deprecated ``shared_ptr`` Atomic Access APIs from C++26
- P2302R4 - ``std::ranges::contains``
- P1659R3 - ``std::ranges::starts_with`` and ``std::ranges::ends_with``
@@ -54,6 +55,9 @@ Improvements and New Features
- The ``std::mismatch`` algorithm has been optimized for integral types, which can lead up to 40x performance
improvements.
+- The ``_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS`` macro has been added to make the declarations in ``<memory>``
+ available.
+
Deprecations and Removals
-------------------------
diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h
index 794a794d8fd85a..05d3f4375a71a0 100644
--- a/libcxx/include/__memory/shared_ptr.h
+++ b/libcxx/include/__memory/shared_ptr.h
@@ -1581,6 +1581,8 @@ class _LIBCPP_EXPORTED_FROM_ABI __sp_mut {
_LIBCPP_EXPORTED_FROM_ABI __sp_mut& __get_sp_mut(const void*);
+# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS)
+
template <class _Tp>
inline _LIBCPP_HIDE_FROM_ABI bool atomic_is_lock_free(const shared_ptr<_Tp>*) {
return false;
@@ -1664,6 +1666,8 @@ inline _LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_weak_explicit(
return std::atomic_compare_exchange_weak(__p, __v, __w);
}
+# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS)
+
#endif // !defined(_LIBCPP_HAS_NO_THREADS)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/memory b/libcxx/include/memory
index a8c0264eb9eb78..d7f34b64080dcc 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -830,34 +830,34 @@ public:
};
template<class T>
- bool atomic_is_lock_free(const shared_ptr<T>* p);
+ bool atomic_is_lock_free(const shared_ptr<T>* p); // Removed in C++26
template<class T>
- shared_ptr<T> atomic_load(const shared_ptr<T>* p);
+ shared_ptr<T> atomic_load(const shared_ptr<T>* p); // Removed in C++26
template<class T>
- shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo);
+ shared_ptr<T> atomic_load_explicit(const shared_ptr<T>* p, memory_order mo); // Removed in C++26
template<class T>
- void atomic_store(shared_ptr<T>* p, shared_ptr<T> r);
+ void atomic_store(shared_ptr<T>* p, shared_ptr<T> r); // Removed in C++26
template<class T>
- void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
+ void atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); // Removed in C++26
template<class T>
- shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r);
+ shared_ptr<T> atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r); // Removed in C++26
template<class T>
shared_ptr<T>
- atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo);
+ atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo); // Removed in C++26
template<class T>
bool
- atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
+ atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); // Removed in C++26
template<class T>
bool
- atomic_compare_exchange_strong( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w);
+ atomic_compare_exchange_strong( shared_ptr<T>* p, shared_ptr<T>* v, shared_ptr<T> w); // Removed in C++26
template<class T>
bool
- atomic_compare_exchange_weak_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
+ atomic_compare_exchange_weak_explicit(shared_ptr<T>* p, shared_ptr<T>* v, // Removed in C++26
shared_ptr<T> w, memory_order success,
memory_order failure);
template<class T>
bool
- atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
+ atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v, // Removed in C++26
shared_ptr<T> w, memory_order success,
memory_order failure);
// Hash support
diff --git a/libcxx/modules/std/memory.inc b/libcxx/modules/std/memory.inc
index 56c621c0cf17fb..28afbab67bfc02 100644
--- a/libcxx/modules/std/memory.inc
+++ b/libcxx/modules/std/memory.inc
@@ -190,6 +190,9 @@ export namespace std {
// using std::inout_ptr;
#ifndef _LIBCPP_HAS_NO_THREADS
+
+# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS)
+
// [depr.util.smartptr.shared.atomic]
using std::atomic_is_lock_free;
@@ -206,5 +209,8 @@ export namespace std {
using std::atomic_compare_exchange_strong_explicit;
using std::atomic_compare_exchange_weak;
using std::atomic_compare_exchange_weak_explicit;
+
+# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS)
+
#endif // _LIBCPP_HAS_NO_THREADS
} // namespace std
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
index 37be6ceea3e094..0e565c1b0424df 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -15,7 +16,7 @@
// template <class T>
// bool
// atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v,
-// shared_ptr<T> w);
+// shared_ptr<T> w); // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
index 3965863b86ccf5..1180c2cc2138a9 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -16,7 +17,7 @@
// bool
// atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
// shared_ptr<T> w, memory_order success,
-// memory_order failure);
+// memory_order failure); // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
index 6dd04f924a105e..6f80c86f6dc214 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -15,7 +16,7 @@
// template <class T>
// bool
// atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v,
-// shared_ptr<T> w);
+// shared_ptr<T> w); // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
index 4837fa9793a5e8..f15fed4cc8f636 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -16,7 +17,7 @@
// bool
// atomic_compare_exchange_weak_explicit(shared_ptr<T>* p, shared_ptr<T>* v,
// shared_ptr<T> w, memory_order success,
-// memory_order failure);
+// memory_order failure); // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
index f488e0ed1d14e1..abf98a364f2ef8 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// shared_ptr<T>
-// atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r)
+// atomic_exchange(shared_ptr<T>* p, shared_ptr<T> r) // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
index 1945f7bba6dc06..e6d66878c303de 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// shared_ptr<T>
-// atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r)
+// atomic_exchange_explicit(shared_ptr<T>* p, shared_ptr<T> r) // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_is_lock_free.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_is_lock_free.pass.cpp
index 37f7d12eda2c62..3390a64a1358a5 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_is_lock_free.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_is_lock_free.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template<class T>
// bool
-// atomic_is_lock_free(const shared_ptr<T>* p);
+// atomic_is_lock_free(const shared_ptr<T>* p); // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
index 1b9a15ac92ac1f..b298ffe840e287 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// shared_ptr<T>
-// atomic_load(const shared_ptr<T>* p)
+// atomic_load(const shared_ptr<T>* p) // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
index 5c2970133328f3..f924f090af297d 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// shared_ptr<T>
-// atomic_load_explicit(const shared_ptr<T>* p, memory_order mo)
+// atomic_load_explicit(const shared_ptr<T>* p, memory_order mo) // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
index 5b7bd5fad69c47..5f978fc5f16b32 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// void
-// atomic_store(shared_ptr<T>* p, shared_ptr<T> r)
+// atomic_store(shared_ptr<T>* p, shared_ptr<T> r) // Removed in C++26
// UNSUPPORTED: c++03
diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
index 5712190421308d..62f75533da97bd 100644
--- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
+++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
@@ -5,7 +5,8 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-//
+
+// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS
// UNSUPPORTED: no-threads
// <memory>
@@ -14,7 +15,7 @@
// template <class T>
// void
-// atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo)
+// atomic_store_explicit(shared_ptr<T>* p, shared_ptr<T> r, memory_order mo) // Removed in C++26
// UNSUPPORTED: c++03
|
3e8d1c9
to
69715ec
Compare
69715ec
to
303cb9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this!
While reviewing your patch I noticed we have not implemented P0718R2. This paper deprecates shared_ptr
Atomic Access APIs. I don't like to remove this feature when we don't issue deprecation messages. Can you implement P0718R2 too? I'm fine to have it in the same patch. If you do it in this patch please update the title and the description.
shared_ptr
Atomic Access APIs from C++26shared_ptr
Atomic Access APIs from C++26 & Deprecated shared_ptr
Atomic Access APIs from P0718R2
…red_ptr-Atomic-Access-APIs
shared_ptr
Atomic Access APIs from C++26 & Deprecated shared_ptr
Atomic Access APIs from P0718R2shared_ptr
Atomic Access APIs from C++26 & Deprecated shared_ptr
Atomic Access APIs as per P0718R2
shared_ptr
Atomic Access APIs from C++26 & Deprecated shared_ptr
Atomic Access APIs as per P0718R2shared_ptr
Atomic Access APIs as per P0718R2 & P2869R3: Remove Deprecated shared_ptr
Atomic Access APIs from C++26
@mordante Thank you for the review. I implemented the deprecations as per P0718R2 The remaining parts of the paper are not a subject of this patch. There is another probably stale PR: #78317 implementing |
…red_ptr-Atomic-Access-APIs
shared_ptr
Atomic Access APIs as per P0718R2 & P2869R3: Remove Deprecated shared_ptr
Atomic Access APIs from C++26shared_ptr
Atomic Access APIs as per P0718R2 & Implemented P2869R3: Remove Deprecated shared_ptr
Atomic Access APIs from C++26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo some minor nits.
libcxx/docs/Status/Cxx20Papers.csv
Outdated
@@ -12,7 +12,7 @@ | |||
"`P0600R1 <https://wg21.link/P0600R1>`__","LWG","nodiscard in the Library","Albuquerque","|Complete|","16.0" | |||
"`P0616R0 <https://wg21.link/P0616R0>`__","LWG","de-pessimize legacy <numeric> algorithms with std::move","Albuquerque","|Complete|","12.0" | |||
"`P0653R2 <https://wg21.link/P0653R2>`__","LWG","Utility to convert a pointer to a raw pointer","Albuquerque","|Complete|","6.0" | |||
"`P0718R2 <https://wg21.link/P0718R2>`__","LWG","Atomic shared_ptr","Albuquerque","","" | |||
"`P0718R2 <https://wg21.link/P0718R2>`__","LWG","Atomic shared_ptr","Albuquerque","|Partial|","19.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds a link to the note you created.
In general we only add a version when it's complete, feel free to add the version to the note.
"`P0718R2 <https://wg21.link/P0718R2>`__","LWG","Atomic shared_ptr","Albuquerque","|Partial|","19.0" | |
"`P0718R2 <https://wg21.link/P0718R2>`__","LWG","Atomic shared_ptr","Albuquerque","|Partial| [#note-P0718]_","" |
@@ -0,0 +1,32 @@ | |||
//===----------------------------------------------------------------------===// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These deprecated tests are typically in libcxx/test/libcxx/depr/depr.XXX
where XXX is the section name in the Standard. They typically have a cxxYY too in their name. (We're not very consistent in this naming but let's match that generic direction.)
Thank you! |
…Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26 (llvm#87111) Implements https://wg21.link/P2869R4 Implements deprecations as per https://wg21.link/P0718R2
As mentioned before, it'd be very useful to have opt-out flags for deprecations. #80542 (comment) claims that "deprecation warnings are introduced in newer standards only", but in our experience that just isn't true (and isn't true here). The MSVC STL does have an opt-out macro per deprecated thing. (@ldionne) We're once again in the situation that we can't update libc++ before cleaning up this (and possibly other) deprecation warnings. It would be considerably easier if we could update (with a define to disable this deprecation warning) and the fix the warning asynchronously. (I didn't notice this earlier because it took us 5 weeks to fix the last thing that we couldn't fix asynchronously, and we just now updated libc++ for the first time in 5 weeks, to the version that was current 5 weeks ago, shortly before this here landed.) |
AFAIK that comment states that |
We're trying to use the replacement over in google/perfetto#785 . https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2869r2.pdf suggests to use Maybe we're holding something wrong, but https://libcxx.llvm.org/FeatureTestMacroTable.html says "__cpp_lib_atomic_shared_ptr unimplemented". Which suggests that the recommended replacement doesn't work in ilbc++ yet. Is that correct? If so, I'll suggest that adding this deprecation is premature. |
Catch up with chromium's latest libcxx. Bug: llvm/llvm-project#87111 Change-Id: I1d8d1c051feeca592ec064c715106d0b70acfb9e
@mordante and @H-G-Hristov: ping? Have you had a chance to consider nico's comment above? |
This patch reverts 9b832b7 (#87111): - [libc++] Deprecated `shared_ptr` Atomic Access APIs as per P0718R2 - [libc++] Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26 As explained in [1], the suggested replacement in P2869R3 is `__cpp_lib_atomic_shared_ptr`, which libc++ does not yet implement. Let's not deprecate the old way of doing things before the new way of doing things exists. [1]: #87111 (comment)
This patch reverts 9b832b72 (#87111): - [libc++] Deprecated `shared_ptr` Atomic Access APIs as per P0718R2 - [libc++] Implemented P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs from C++26 As explained in [1], the suggested replacement in P2869R3 is `__cpp_lib_atomic_shared_ptr`, which libc++ does not yet implement. Let's not deprecate the old way of doing things before the new way of doing things exists. [1]: llvm/llvm-project#87111 (comment) NOKEYCHECK=True GitOrigin-RevId: 716ed5fccd2a960981fec2c5acb17292a1502435
Implements https://wg21.link/P2869R4
Implements deprecations as per https://wg21.link/P0718R2