-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[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
Merged
Zingam
merged 12 commits into
llvm:main
from
H-G-Hristov:hgh/libcxx/P2869R3-Remove-Deprecated-std_shared_ptr-Atomic-Access-APIs
Apr 14, 2024
Merged
Changes from 9 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f8060ad
[libc++] P2869R3: Remove Deprecated `shared_ptr` Atomic Access APIs f…
H-G-Hristov 8671e48
Try to fix CI
H-G-Hristov 303cb9a
Updated release notes and status pages
H-G-Hristov 397324a
Minor tweaks
H-G-Hristov bc923dc
Addressed review comments: Implements deprecations from https://wg21.…
H-G-Hristov 535bcf8
Fixed formatting
H-G-Hristov e2a97a6
Merge branch 'main' into hgh/libcxx/P2869R3-Remove-Deprecated-std_sha…
H-G-Hristov 21e2f3a
Updated paper status
H-G-Hristov bf87944
Merge branch 'main' into hgh/libcxx/P2869R3-Remove-Deprecated-std_sha…
H-G-Hristov b93db50
Addressed comments
H-G-Hristov be4a5f6
Renamed deprecated tests
H-G-Hristov 9e33ace
Merge branch 'main' into hgh/libcxx/P2869R3-Remove-Deprecated-std_sha…
H-G-Hristov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...emory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.verify.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//===----------------------------------------------------------------------===// | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These deprecated tests are typically in |
||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS | ||
// UNSUPPORTED: no-threads | ||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | ||
|
||
// <memory> | ||
|
||
// shared_ptr | ||
|
||
// template <class T> | ||
// bool | ||
// atomic_compare_exchange_strong(shared_ptr<T>* p, shared_ptr<T>* v, | ||
// shared_ptr<T> w); // Deprecated in C++20, removed in C++26 | ||
|
||
#include <atomic> | ||
#include <memory> | ||
#include <tuple> | ||
|
||
void test() { | ||
std::shared_ptr<int> p(new int(4)); | ||
std::shared_ptr<int> v(new int(3)); | ||
std::shared_ptr<int> w(new int(2)); | ||
// expected-warning@+1 {{'atomic_compare_exchange_strong<int>' is deprecated}} | ||
std::ignore = std::atomic_compare_exchange_strong(&p, &v, w); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...l.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.verify.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS | ||
// UNSUPPORTED: no-threads | ||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | ||
|
||
// <memory> | ||
|
||
// shared_ptr | ||
|
||
// template <class T> | ||
// bool | ||
// atomic_compare_exchange_strong_explicit(shared_ptr<T>* p, shared_ptr<T>* v, | ||
// shared_ptr<T> w, memory_order success, | ||
// memory_order failure); // Deprecated in C++20, removed in C++26 | ||
|
||
#include <atomic> | ||
#include <memory> | ||
#include <tuple> | ||
|
||
void test() { | ||
std::shared_ptr<int> p(new int(4)); | ||
std::shared_ptr<int> v(new int(3)); | ||
std::shared_ptr<int> w(new int(2)); | ||
// expected-warning@+2 {{'atomic_compare_exchange_strong_explicit<int>' is deprecated}} | ||
std::ignore = | ||
std::atomic_compare_exchange_strong_explicit(&p, &v, w, std::memory_order_seq_cst, std::memory_order_seq_cst); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
.../memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.verify.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_SHARED_PTR_ATOMICS | ||
// UNSUPPORTED: no-threads | ||
// UNSUPPORTED: c++03, c++11, c++14, c++17 | ||
|
||
// <memory> | ||
|
||
// shared_ptr | ||
|
||
// template <class T> | ||
// bool | ||
// atomic_compare_exchange_weak(shared_ptr<T>* p, shared_ptr<T>* v, | ||
// shared_ptr<T> w); // Deprecated in C++20, removed in C++26 | ||
|
||
#include <memory> | ||
#include <tuple> | ||
|
||
int main(int, char**) { | ||
std::shared_ptr<int> p(new int(4)); | ||
std::shared_ptr<int> v(new int(3)); | ||
std::shared_ptr<int> w(new int(2)); | ||
// expected-warning@+1 {{'atomic_compare_exchange_weak<int>' is deprecated}} | ||
std::ignore = std::atomic_compare_exchange_weak(&p, &v, w); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.