-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[libc++] Set __cpp_lib_smart_ptr_for_overwrite
#114700
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
frederick-vs-ja
merged 2 commits into
llvm:main
from
frederick-vs-ja:ftm-smart-ptr-for-overwrite
Nov 5, 2024
Merged
[libc++] Set __cpp_lib_smart_ptr_for_overwrite
#114700
frederick-vs-ja
merged 2 commits into
llvm:main
from
frederick-vs-ja:ftm-smart-ptr-for-overwrite
Nov 5, 2024
Conversation
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
The features were implemented in LLVM 16, but mistakenly considered unimplemented in FTM tools.
@llvm/pr-subscribers-libcxx Author: A. Jiang (frederick-vs-ja) ChangesThe features were implemented in LLVM 16, but mistakenly considered unimplemented in FTM tools. Full diff: https://github.com/llvm/llvm-project/pull/114700.diff 6 Files Affected:
diff --git a/libcxx/docs/FeatureTestMacroTable.rst b/libcxx/docs/FeatureTestMacroTable.rst
index db24b65caca6c0..3c4a13332661ee 100644
--- a/libcxx/docs/FeatureTestMacroTable.rst
+++ b/libcxx/docs/FeatureTestMacroTable.rst
@@ -278,7 +278,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_shift`` ``201806L``
---------------------------------------------------------- -----------------
- ``__cpp_lib_smart_ptr_for_overwrite`` *unimplemented*
+ ``__cpp_lib_smart_ptr_for_overwrite`` ``202002L``
---------------------------------------------------------- -----------------
``__cpp_lib_source_location`` ``201907L``
---------------------------------------------------------- -----------------
diff --git a/libcxx/docs/Status/Cxx20Papers.csv b/libcxx/docs/Status/Cxx20Papers.csv
index 5cd77be4d58def..2a1e43977089f2 100644
--- a/libcxx/docs/Status/Cxx20Papers.csv
+++ b/libcxx/docs/Status/Cxx20Papers.csv
@@ -68,7 +68,7 @@
"`P0972R0 <https://wg21.link/P0972R0>`__","<chrono> ``zero()``\ , ``min()``\ , and ``max()``\ should be noexcept","2018-11 (San Diego)","|Complete|","8.0",""
"`P1006R1 <https://wg21.link/P1006R1>`__","Constexpr in std::pointer_traits","2018-11 (San Diego)","|Complete|","8.0",""
"`P1007R3 <https://wg21.link/P1007R3>`__","``std::assume_aligned``\ ","2018-11 (San Diego)","|Complete|","15.0",""
-"`P1020R1 <https://wg21.link/P1020R1>`__","Smart pointer creation with default initialization","2018-11 (San Diego)","|Complete|","16.0",""
+"`P1020R1 <https://wg21.link/P1020R1>`__","Smart pointer creation with default initialization","2018-11 (San Diego)","|Complete|","16.0","The feature-test macro was not set until LLVM 20."
"`P1032R1 <https://wg21.link/P1032R1>`__","Misc constexpr bits","2018-11 (San Diego)","|Complete|","13.0",""
"`P1085R2 <https://wg21.link/P1085R2>`__","Should Span be Regular?","2018-11 (San Diego)","|Complete|","8.0",""
"`P1123R0 <https://wg21.link/P1123R0>`__","Editorial Guidance for merging P0019r8 and P0528r3","2018-11 (San Diego)","","",""
@@ -177,7 +177,7 @@
"`P1963R0 <https://wg21.link/P1963R0>`__","Fixing US 313","2020-02 (Prague)","","",""
"`P1964R2 <https://wg21.link/P1964R2>`__","Wording for boolean-testable","2020-02 (Prague)","|Complete|","13.0",""
"`P1970R2 <https://wg21.link/P1970R2>`__","Consistency for size() functions: Add ranges::ssize","2020-02 (Prague)","|Complete|","15.0",""
-"`P1973R1 <https://wg21.link/P1973R1>`__","Rename ""_default_init"" Functions, Rev1","2020-02 (Prague)","|Complete|","16.0",""
+"`P1973R1 <https://wg21.link/P1973R1>`__","Rename ""_default_init"" Functions, Rev1","2020-02 (Prague)","|Complete|","16.0","The feature-test macro was not set until LLVM 20."
"`P1976R2 <https://wg21.link/P1976R2>`__","Fixed-size span construction from dynamic range","2020-02 (Prague)","|Complete|","11.0",""
"`P1981R0 <https://wg21.link/P1981R0>`__","Rename leap to leap_second","2020-02 (Prague)","|Complete|","19.0",""
"`P1982R0 <https://wg21.link/P1982R0>`__","Rename link to time_zone_link","2020-02 (Prague)","|Complete|","19.0",""
diff --git a/libcxx/include/version b/libcxx/include/version
index cb75f3b2db681c..571b6e39381d1e 100644
--- a/libcxx/include/version
+++ b/libcxx/include/version
@@ -443,7 +443,7 @@ __cpp_lib_void_t 201411L <type_traits>
# undef __cpp_lib_shared_ptr_arrays
# define __cpp_lib_shared_ptr_arrays 201707L
# define __cpp_lib_shift 201806L
-// # define __cpp_lib_smart_ptr_for_overwrite 202002L
+# define __cpp_lib_smart_ptr_for_overwrite 202002L
# define __cpp_lib_source_location 201907L
# define __cpp_lib_span 202002L
# define __cpp_lib_ssize 201902L
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
index 315058f7f46370..0094bed44be071 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp
@@ -390,17 +390,11 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
# endif
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -521,17 +515,11 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
# endif
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -652,17 +640,11 @@
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
index 5deaee16895f66..74db80c4d642e4 100644
--- a/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
@@ -4344,17 +4344,11 @@
# error "__cpp_lib_shift should have the value 201806L in c++20"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
# endif
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -5929,17 +5923,11 @@
# error "__cpp_lib_shift should have the value 201806L in c++23"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
# endif
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -7829,17 +7817,11 @@
# error "__cpp_lib_shift should have the value 201806L in c++26"
# endif
-# if !defined(_LIBCPP_VERSION)
-# ifndef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
-# endif
-# if __cpp_lib_smart_ptr_for_overwrite != 202002L
-# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
-# endif
-# else // _LIBCPP_VERSION
-# ifdef __cpp_lib_smart_ptr_for_overwrite
-# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
-# endif
+# ifndef __cpp_lib_smart_ptr_for_overwrite
+# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
+# endif
+# if __cpp_lib_smart_ptr_for_overwrite != 202002L
+# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
# endif
# if !defined(_LIBCPP_VERSION)
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index 197d6bbc692226..c32d8d77c88577 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -1196,7 +1196,6 @@ def add_version_header(tc):
"name": "__cpp_lib_smart_ptr_for_overwrite",
"values": {"c++20": 202002},
"headers": ["memory"],
- "unimplemented": True,
},
{
"name": "__cpp_lib_smart_ptr_owner_equality",
|
ldionne
approved these changes
Nov 4, 2024
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!
PhilippRados
pushed a commit
to PhilippRados/llvm-project
that referenced
this pull request
Nov 6, 2024
The features were implemented in LLVM 16, but mistakenly considered unimplemented in FTM tools.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The features were implemented in LLVM 16, but mistakenly considered unimplemented in FTM tools.