Skip to content

Commit 5c7b6b1

Browse files
frederick-vs-jaPhilippRados
authored andcommitted
[libc++] Set __cpp_lib_smart_ptr_for_overwrite (llvm#114700)
The features were implemented in LLVM 16, but mistakenly considered unimplemented in FTM tools.
1 parent 8c85564 commit 5c7b6b1

File tree

6 files changed

+34
-71
lines changed

6 files changed

+34
-71
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ Status
278278
---------------------------------------------------------- -----------------
279279
``__cpp_lib_shift`` ``201806L``
280280
---------------------------------------------------------- -----------------
281-
``__cpp_lib_smart_ptr_for_overwrite`` *unimplemented*
281+
``__cpp_lib_smart_ptr_for_overwrite`` ``202002L``
282282
---------------------------------------------------------- -----------------
283283
``__cpp_lib_source_location`` ``201907L``
284284
---------------------------------------------------------- -----------------

libcxx/docs/Status/Cxx20Papers.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"`P0972R0 <https://wg21.link/P0972R0>`__","<chrono> ``zero()``\ , ``min()``\ , and ``max()``\ should be noexcept","2018-11 (San Diego)","|Complete|","8",""
6969
"`P1006R1 <https://wg21.link/P1006R1>`__","Constexpr in std::pointer_traits","2018-11 (San Diego)","|Complete|","8",""
7070
"`P1007R3 <https://wg21.link/P1007R3>`__","``std::assume_aligned``\ ","2018-11 (San Diego)","|Complete|","15",""
71-
"`P1020R1 <https://wg21.link/P1020R1>`__","Smart pointer creation with default initialization","2018-11 (San Diego)","|Complete|","16",""
71+
"`P1020R1 <https://wg21.link/P1020R1>`__","Smart pointer creation with default initialization","2018-11 (San Diego)","|Complete|","16","The feature-test macro was not set until LLVM 20."
7272
"`P1032R1 <https://wg21.link/P1032R1>`__","Misc constexpr bits","2018-11 (San Diego)","|Complete|","13",""
7373
"`P1085R2 <https://wg21.link/P1085R2>`__","Should Span be Regular?","2018-11 (San Diego)","|Complete|","8",""
7474
"`P1123R0 <https://wg21.link/P1123R0>`__","Editorial Guidance for merging P0019r8 and P0528r3","2018-11 (San Diego)","","",""
@@ -177,7 +177,7 @@
177177
"`P1963R0 <https://wg21.link/P1963R0>`__","Fixing US 313","2020-02 (Prague)","","",""
178178
"`P1964R2 <https://wg21.link/P1964R2>`__","Wording for boolean-testable","2020-02 (Prague)","|Complete|","13",""
179179
"`P1970R2 <https://wg21.link/P1970R2>`__","Consistency for size() functions: Add ranges::ssize","2020-02 (Prague)","|Complete|","15",""
180-
"`P1973R1 <https://wg21.link/P1973R1>`__","Rename ""_default_init"" Functions, Rev1","2020-02 (Prague)","|Complete|","16",""
180+
"`P1973R1 <https://wg21.link/P1973R1>`__","Rename ""_default_init"" Functions, Rev1","2020-02 (Prague)","|Complete|","16","The feature-test macro was not set until LLVM 20."
181181
"`P1976R2 <https://wg21.link/P1976R2>`__","Fixed-size span construction from dynamic range","2020-02 (Prague)","|Complete|","11",""
182182
"`P1981R0 <https://wg21.link/P1981R0>`__","Rename leap to leap_second","2020-02 (Prague)","|Complete|","19",""
183183
"`P1982R0 <https://wg21.link/P1982R0>`__","Rename link to time_zone_link","2020-02 (Prague)","|Complete|","19",""

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ __cpp_lib_void_t 201411L <type_traits>
443443
# undef __cpp_lib_shared_ptr_arrays
444444
# define __cpp_lib_shared_ptr_arrays 201707L
445445
# define __cpp_lib_shift 201806L
446-
// # define __cpp_lib_smart_ptr_for_overwrite 202002L
446+
# define __cpp_lib_smart_ptr_for_overwrite 202002L
447447
# define __cpp_lib_source_location 201907L
448448
# define __cpp_lib_span 202002L
449449
# define __cpp_lib_ssize 201902L

libcxx/test/std/language.support/support.limits/support.limits.general/memory.version.compile.pass.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,11 @@
390390
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20"
391391
# endif
392392

393-
# if !defined(_LIBCPP_VERSION)
394-
# ifndef __cpp_lib_smart_ptr_for_overwrite
395-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
396-
# endif
397-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
398-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
399-
# endif
400-
# else // _LIBCPP_VERSION
401-
# ifdef __cpp_lib_smart_ptr_for_overwrite
402-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
403-
# endif
393+
# ifndef __cpp_lib_smart_ptr_for_overwrite
394+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
395+
# endif
396+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
397+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
404398
# endif
405399

406400
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -521,17 +515,11 @@
521515
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23"
522516
# endif
523517

524-
# if !defined(_LIBCPP_VERSION)
525-
# ifndef __cpp_lib_smart_ptr_for_overwrite
526-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
527-
# endif
528-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
529-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
530-
# endif
531-
# else // _LIBCPP_VERSION
532-
# ifdef __cpp_lib_smart_ptr_for_overwrite
533-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
534-
# endif
518+
# ifndef __cpp_lib_smart_ptr_for_overwrite
519+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
520+
# endif
521+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
522+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
535523
# endif
536524

537525
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -652,17 +640,11 @@
652640
# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26"
653641
# endif
654642

655-
# if !defined(_LIBCPP_VERSION)
656-
# ifndef __cpp_lib_smart_ptr_for_overwrite
657-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
658-
# endif
659-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
660-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
661-
# endif
662-
# else // _LIBCPP_VERSION
663-
# ifdef __cpp_lib_smart_ptr_for_overwrite
664-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
665-
# endif
643+
# ifndef __cpp_lib_smart_ptr_for_overwrite
644+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
645+
# endif
646+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
647+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
666648
# endif
667649

668650
# if !defined(_LIBCPP_VERSION)

libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4344,17 +4344,11 @@
43444344
# error "__cpp_lib_shift should have the value 201806L in c++20"
43454345
# endif
43464346

4347-
# if !defined(_LIBCPP_VERSION)
4348-
# ifndef __cpp_lib_smart_ptr_for_overwrite
4349-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
4350-
# endif
4351-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
4352-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
4353-
# endif
4354-
# else // _LIBCPP_VERSION
4355-
# ifdef __cpp_lib_smart_ptr_for_overwrite
4356-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
4357-
# endif
4347+
# ifndef __cpp_lib_smart_ptr_for_overwrite
4348+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20"
4349+
# endif
4350+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
4351+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20"
43584352
# endif
43594353

43604354
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -5929,17 +5923,11 @@
59295923
# error "__cpp_lib_shift should have the value 201806L in c++23"
59305924
# endif
59315925

5932-
# if !defined(_LIBCPP_VERSION)
5933-
# ifndef __cpp_lib_smart_ptr_for_overwrite
5934-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
5935-
# endif
5936-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
5937-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
5938-
# endif
5939-
# else // _LIBCPP_VERSION
5940-
# ifdef __cpp_lib_smart_ptr_for_overwrite
5941-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
5942-
# endif
5926+
# ifndef __cpp_lib_smart_ptr_for_overwrite
5927+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23"
5928+
# endif
5929+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
5930+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23"
59435931
# endif
59445932

59455933
# ifdef __cpp_lib_smart_ptr_owner_equality
@@ -7829,17 +7817,11 @@
78297817
# error "__cpp_lib_shift should have the value 201806L in c++26"
78307818
# endif
78317819

7832-
# if !defined(_LIBCPP_VERSION)
7833-
# ifndef __cpp_lib_smart_ptr_for_overwrite
7834-
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
7835-
# endif
7836-
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
7837-
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
7838-
# endif
7839-
# else // _LIBCPP_VERSION
7840-
# ifdef __cpp_lib_smart_ptr_for_overwrite
7841-
# error "__cpp_lib_smart_ptr_for_overwrite should not be defined because it is unimplemented in libc++!"
7842-
# endif
7820+
# ifndef __cpp_lib_smart_ptr_for_overwrite
7821+
# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26"
7822+
# endif
7823+
# if __cpp_lib_smart_ptr_for_overwrite != 202002L
7824+
# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26"
78437825
# endif
78447826

78457827
# if !defined(_LIBCPP_VERSION)

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,6 @@ def add_version_header(tc):
11961196
"name": "__cpp_lib_smart_ptr_for_overwrite",
11971197
"values": {"c++20": 202002},
11981198
"headers": ["memory"],
1199-
"unimplemented": True,
12001199
},
12011200
{
12021201
"name": "__cpp_lib_smart_ptr_owner_equality",

0 commit comments

Comments
 (0)