Skip to content

Commit a5b4479

Browse files
committed
[libc++] Add papers from February 2022 plenary meeting
Reviewed By: ldionne, Quuxplusone, #libc Spies: arichardson, libcxx-commits Differential Revision: https://reviews.llvm.org/D119189
1 parent 903f6b7 commit a5b4479

23 files changed

+1076
-4
lines changed

libcxx/docs/FeatureTestMacroTable.rst

+20
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,12 @@ Status
302302
------------------------------------------------- -----------------
303303
``__cpp_lib_associative_heterogeneous_erasure`` *unimplemented*
304304
------------------------------------------------- -----------------
305+
``__cpp_lib_bind_back`` *unimplemented*
306+
------------------------------------------------- -----------------
305307
``__cpp_lib_byteswap`` ``202110L``
306308
------------------------------------------------- -----------------
309+
``__cpp_lib_constexpr_cmath`` *unimplemented*
310+
------------------------------------------------- -----------------
307311
``__cpp_lib_constexpr_typeinfo`` *unimplemented*
308312
------------------------------------------------- -----------------
309313
``__cpp_lib_invoke_r`` *unimplemented*
@@ -316,10 +320,24 @@ Status
316320
------------------------------------------------- -----------------
317321
``__cpp_lib_out_ptr`` *unimplemented*
318322
------------------------------------------------- -----------------
323+
``__cpp_lib_ranges_chunk`` *unimplemented*
324+
------------------------------------------------- -----------------
325+
``__cpp_lib_ranges_chunk_by`` *unimplemented*
326+
------------------------------------------------- -----------------
327+
``__cpp_lib_ranges_iota`` *unimplemented*
328+
------------------------------------------------- -----------------
329+
``__cpp_lib_ranges_join_with`` *unimplemented*
330+
------------------------------------------------- -----------------
331+
``__cpp_lib_ranges_slide`` *unimplemented*
332+
------------------------------------------------- -----------------
319333
``__cpp_lib_ranges_starts_ends_with`` *unimplemented*
320334
------------------------------------------------- -----------------
335+
``__cpp_lib_ranges_to_container`` *unimplemented*
336+
------------------------------------------------- -----------------
321337
``__cpp_lib_ranges_zip`` *unimplemented*
322338
------------------------------------------------- -----------------
339+
``__cpp_lib_reference_from_temporary`` *unimplemented*
340+
------------------------------------------------- -----------------
323341
``__cpp_lib_spanstream`` *unimplemented*
324342
------------------------------------------------- -----------------
325343
``__cpp_lib_stacktrace`` *unimplemented*
@@ -331,5 +349,7 @@ Status
331349
``__cpp_lib_string_resize_and_overwrite`` ``202110L``
332350
------------------------------------------------- -----------------
333351
``__cpp_lib_to_underlying`` ``202102L``
352+
------------------------------------------------- -----------------
353+
``__cpp_lib_unreachable`` *unimplemented*
334354
================================================= =================
335355

libcxx/docs/Status/Cxx2bPapers.csv

+14-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"`P2212R2 <https://wg21.link/P2212R2>`__","LWG","Relax Requirements for time_point::clock","February 2021","",""
1212
"`P2259R1 <https://wg21.link/P2259R1>`__","LWG","Repairing input range adaptors and counted_iterator","February 2021","",""
1313
"","","","","",""
14-
"`P0401R6 <https://wg21.link/P0401R6>`__","LWG","Providing size feedback in the Allocator interface","June 2021","",
14+
"`P0401R6 <https://wg21.link/P0401R6>`__","LWG","Providing size feedback in the Allocator interface","June 2021","",""
1515
"`P0448R4 <https://wg21.link/P0448R4>`__","LWG","A strstream replacement using span<charT> as buffer","June 2021","",""
1616
"`P1132R8 <https://wg21.link/P1132R8>`__","LWG","out_ptr - a scalable output pointer abstraction","June 2021","",""
1717
"`P1328R1 <https://wg21.link/P1328R1>`__","LWG","Making std::type_info::operator== constexpr","June 2021","",""
@@ -38,3 +38,16 @@
3838
"`P2393R1 <https://wg21.link/P2393R1>`__","LWG","Cleaning up ``integer``-class types","October 2021","",""
3939
"`P2401R0 <https://wg21.link/P2401R0>`__","LWG","Add a conditional ``noexcept`` specification to ``std::exchange``","October 2021","|Complete|","14.0"
4040
"","","","","",""
41+
"`P0323R12 <https://wg21.link/P0323R12>`__","LWG","``std::expected``","February 2022","",""
42+
"`P0533R9 <https://wg21.link/P0533R9>`__","LWG","``constexpr`` for ``<cmath>`` and ``<cstdlib>``","February 2022","",""
43+
"`P0627R6 <https://wg21.link/P0627R6>`__","LWG","Function to mark unreachable code","February 2022","",""
44+
"`P1206R7 <https://wg21.link/P1206R7>`__","LWG","``ranges::to``: A function to convert any range to a container","February 2022","",""
45+
"`P1413R3 <https://wg21.link/P1413R3>`__","LWG","Deprecate ``std::aligned_storage`` and ``std::aligned_union``","February 2022","",""
46+
"`P2255R3 <https://wg21.link/P2255R3>`__","LWG","A type trait to detect reference binding to temporary","February 2022","",""
47+
"`P2273R3 <https://wg21.link/P2273R3>`__","LWG","Making ``std::unique_ptr`` constexpr","February 2022","",""
48+
"`P2387R3 <https://wg21.link/P2387R3>`__","LWG","Pipe support for user-defined range adaptors","February 2022","",""
49+
"`P2440R1 <https://wg21.link/P2440R1>`__","LWG","``ranges::iota``, ``ranges::shift_left`` and ``ranges::shift_right``","February 2022","",""
50+
"`P2441R2 <https://wg21.link/P2441R2>`__","LWG","``views::join_view``","February 2022","",""
51+
"`P2442R1 <https://wg21.link/P2442R1>`__","LWG","Windowing range adaptors: ``views::chunk`` and ``views::slide``","February 2022","",""
52+
"`P2443R1 <https://wg21.link/P2443R1>`__","LWG","``views::chunk_by``","February 2022","",""
53+
"","","","","",""

libcxx/include/version

+23
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ __cpp_lib_atomic_shared_ptr 201711L <atomic>
3838
__cpp_lib_atomic_value_initialization 201911L <atomic> <memory>
3939
__cpp_lib_atomic_wait 201907L <atomic>
4040
__cpp_lib_barrier 201907L <barrier>
41+
__cpp_lib_bind_back 202202L <functional>
4142
__cpp_lib_bind_front 201907L <functional>
4243
__cpp_lib_bit_cast 201806L <bit>
4344
__cpp_lib_bitops 201907L <bit>
@@ -55,6 +56,7 @@ __cpp_lib_clamp 201603L <algorithm>
5556
__cpp_lib_complex_udls 201309L <complex>
5657
__cpp_lib_concepts 202002L <concepts>
5758
__cpp_lib_constexpr_algorithms 201806L <algorithm>
59+
__cpp_lib_constexpr_cmath 202202L <cmath> <cstdlib>
5860
__cpp_lib_constexpr_complex 201711L <complex>
5961
__cpp_lib_constexpr_dynamic_alloc 201907L <memory>
6062
__cpp_lib_constexpr_functional 201907L <functional>
@@ -132,9 +134,19 @@ __cpp_lib_polymorphic_allocator 201902L <memory_resource
132134
__cpp_lib_quoted_string_io 201304L <iomanip>
133135
__cpp_lib_ranges 201811L <algorithm> <functional> <iterator>
134136
<memory> <ranges>
137+
__cpp_lib_ranges_chunk 202202L <ranges>
138+
__cpp_lib_ranges_chunk_by 202202L <ranges>
139+
__cpp_lib_ranges_iota 202202L <numeric>
140+
__cpp_lib_ranges_join_with 202202L <ranges>
141+
__cpp_lib_ranges_slide 202202L <ranges>
135142
__cpp_lib_ranges_starts_ends_with 202106L <algorithm>
143+
__cpp_lib_ranges_to_container 202202L <deque> <forward_list> <list>
144+
<map> <priority_queue> <queue>
145+
<set> <stack> <string>
146+
<unordered_map> <unordered_set> <vector>
136147
__cpp_lib_ranges_zip 202110L <ranges> <tuple> <utility>
137148
__cpp_lib_raw_memory_algorithms 201606L <memory>
149+
__cpp_lib_reference_from_temporary 202202L <type_traits>
138150
__cpp_lib_remove_cvref 201711L <type_traits>
139151
__cpp_lib_result_of_sfinae 201210L <functional> <type_traits>
140152
__cpp_lib_robust_nonmodifying_seq_ops 201304L <algorithm>
@@ -174,6 +186,7 @@ __cpp_lib_type_identity 201806L <type_traits>
174186
__cpp_lib_type_trait_variable_templates 201510L <type_traits>
175187
__cpp_lib_uncaught_exceptions 201411L <exception>
176188
__cpp_lib_unordered_map_try_emplace 201411L <unordered_map>
189+
__cpp_lib_unreachable 202202L <utility>
177190
__cpp_lib_unwrap_ref 201811L <functional>
178191
__cpp_lib_variant 202102L <variant>
179192
__cpp_lib_void_t 201411L <type_traits>
@@ -363,21 +376,31 @@ __cpp_lib_void_t 201411L <type_traits>
363376
# define __cpp_lib_adaptor_iterator_pair_constructor 202106L
364377
// # define __cpp_lib_allocate_at_least 202106L
365378
// # define __cpp_lib_associative_heterogeneous_erasure 202110L
379+
// # define __cpp_lib_bind_back 202202L
366380
# define __cpp_lib_byteswap 202110L
381+
// # define __cpp_lib_constexpr_cmath 202202L
367382
// # define __cpp_lib_constexpr_typeinfo 202106L
368383
// # define __cpp_lib_invoke_r 202106L
369384
# define __cpp_lib_is_scoped_enum 202011L
370385
# define __cpp_lib_monadic_optional 202110L
371386
// # define __cpp_lib_move_only_function 202110L
372387
// # define __cpp_lib_out_ptr 202106L
388+
// # define __cpp_lib_ranges_chunk 202202L
389+
// # define __cpp_lib_ranges_chunk_by 202202L
390+
// # define __cpp_lib_ranges_iota 202202L
391+
// # define __cpp_lib_ranges_join_with 202202L
392+
// # define __cpp_lib_ranges_slide 202202L
373393
// # define __cpp_lib_ranges_starts_ends_with 202106L
394+
// # define __cpp_lib_ranges_to_container 202202L
374395
// # define __cpp_lib_ranges_zip 202110L
396+
// # define __cpp_lib_reference_from_temporary 202202L
375397
// # define __cpp_lib_spanstream 202106L
376398
// # define __cpp_lib_stacktrace 202011L
377399
// # define __cpp_lib_stdatomic_h 202011L
378400
# define __cpp_lib_string_contains 202011L
379401
# define __cpp_lib_string_resize_and_overwrite 202110L
380402
# define __cpp_lib_to_underlying 202102L
403+
// # define __cpp_lib_unreachable 202202L
381404
#endif
382405

383406
// clang-format on

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

+30
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// Test the feature test macros defined by <cmath>
1717

1818
/* Constant Value
19+
__cpp_lib_constexpr_cmath 202202L [C++2b]
1920
__cpp_lib_hypot 201603L [C++17]
2021
__cpp_lib_interpolate 201902L [C++20]
2122
__cpp_lib_math_special_functions 201603L [C++17]
@@ -26,6 +27,10 @@
2627

2728
#if TEST_STD_VER < 14
2829

30+
# ifdef __cpp_lib_constexpr_cmath
31+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
32+
# endif
33+
2934
# ifdef __cpp_lib_hypot
3035
# error "__cpp_lib_hypot should not be defined before c++17"
3136
# endif
@@ -40,6 +45,10 @@
4045

4146
#elif TEST_STD_VER == 14
4247

48+
# ifdef __cpp_lib_constexpr_cmath
49+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
50+
# endif
51+
4352
# ifdef __cpp_lib_hypot
4453
# error "__cpp_lib_hypot should not be defined before c++17"
4554
# endif
@@ -54,6 +63,10 @@
5463

5564
#elif TEST_STD_VER == 17
5665

66+
# ifdef __cpp_lib_constexpr_cmath
67+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
68+
# endif
69+
5770
# ifndef __cpp_lib_hypot
5871
# error "__cpp_lib_hypot should be defined in c++17"
5972
# endif
@@ -80,6 +93,10 @@
8093

8194
#elif TEST_STD_VER == 20
8295

96+
# ifdef __cpp_lib_constexpr_cmath
97+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
98+
# endif
99+
83100
# ifndef __cpp_lib_hypot
84101
# error "__cpp_lib_hypot should be defined in c++20"
85102
# endif
@@ -109,6 +126,19 @@
109126

110127
#elif TEST_STD_VER > 20
111128

129+
# if !defined(_LIBCPP_VERSION)
130+
# ifndef __cpp_lib_constexpr_cmath
131+
# error "__cpp_lib_constexpr_cmath should be defined in c++2b"
132+
# endif
133+
# if __cpp_lib_constexpr_cmath != 202202L
134+
# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++2b"
135+
# endif
136+
# else // _LIBCPP_VERSION
137+
# ifdef __cpp_lib_constexpr_cmath
138+
# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
139+
# endif
140+
# endif
141+
112142
# ifndef __cpp_lib_hypot
113143
# error "__cpp_lib_hypot should be defined in c++2b"
114144
# endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// WARNING: This test was generated by generate_feature_test_macro_components.py
10+
// and should not be edited manually.
11+
//
12+
// clang-format off
13+
14+
// <cstdlib>
15+
16+
// Test the feature test macros defined by <cstdlib>
17+
18+
/* Constant Value
19+
__cpp_lib_constexpr_cmath 202202L [C++2b]
20+
*/
21+
22+
#include <cstdlib>
23+
#include "test_macros.h"
24+
25+
#if TEST_STD_VER < 14
26+
27+
# ifdef __cpp_lib_constexpr_cmath
28+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
29+
# endif
30+
31+
#elif TEST_STD_VER == 14
32+
33+
# ifdef __cpp_lib_constexpr_cmath
34+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
35+
# endif
36+
37+
#elif TEST_STD_VER == 17
38+
39+
# ifdef __cpp_lib_constexpr_cmath
40+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
41+
# endif
42+
43+
#elif TEST_STD_VER == 20
44+
45+
# ifdef __cpp_lib_constexpr_cmath
46+
# error "__cpp_lib_constexpr_cmath should not be defined before c++2b"
47+
# endif
48+
49+
#elif TEST_STD_VER > 20
50+
51+
# if !defined(_LIBCPP_VERSION)
52+
# ifndef __cpp_lib_constexpr_cmath
53+
# error "__cpp_lib_constexpr_cmath should be defined in c++2b"
54+
# endif
55+
# if __cpp_lib_constexpr_cmath != 202202L
56+
# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++2b"
57+
# endif
58+
# else // _LIBCPP_VERSION
59+
# ifdef __cpp_lib_constexpr_cmath
60+
# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!"
61+
# endif
62+
# endif
63+
64+
#endif // TEST_STD_VER > 20
65+
66+
int main(int, char**) { return 0; }

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

+30
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
__cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
2020
__cpp_lib_erase_if 202002L [C++20]
2121
__cpp_lib_nonmember_container_access 201411L [C++17]
22+
__cpp_lib_ranges_to_container 202202L [C++2b]
2223
*/
2324

2425
#include <deque>
@@ -38,6 +39,10 @@
3839
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
3940
# endif
4041

42+
# ifdef __cpp_lib_ranges_to_container
43+
# error "__cpp_lib_ranges_to_container should not be defined before c++2b"
44+
# endif
45+
4146
#elif TEST_STD_VER == 14
4247

4348
# ifdef __cpp_lib_allocator_traits_is_always_equal
@@ -52,6 +57,10 @@
5257
# error "__cpp_lib_nonmember_container_access should not be defined before c++17"
5358
# endif
5459

60+
# ifdef __cpp_lib_ranges_to_container
61+
# error "__cpp_lib_ranges_to_container should not be defined before c++2b"
62+
# endif
63+
5564
#elif TEST_STD_VER == 17
5665

5766
# ifndef __cpp_lib_allocator_traits_is_always_equal
@@ -72,6 +81,10 @@
7281
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
7382
# endif
7483

84+
# ifdef __cpp_lib_ranges_to_container
85+
# error "__cpp_lib_ranges_to_container should not be defined before c++2b"
86+
# endif
87+
7588
#elif TEST_STD_VER == 20
7689

7790
# ifndef __cpp_lib_allocator_traits_is_always_equal
@@ -95,6 +108,10 @@
95108
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20"
96109
# endif
97110

111+
# ifdef __cpp_lib_ranges_to_container
112+
# error "__cpp_lib_ranges_to_container should not be defined before c++2b"
113+
# endif
114+
98115
#elif TEST_STD_VER > 20
99116

100117
# ifndef __cpp_lib_allocator_traits_is_always_equal
@@ -118,6 +135,19 @@
118135
# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2b"
119136
# endif
120137

138+
# if !defined(_LIBCPP_VERSION)
139+
# ifndef __cpp_lib_ranges_to_container
140+
# error "__cpp_lib_ranges_to_container should be defined in c++2b"
141+
# endif
142+
# if __cpp_lib_ranges_to_container != 202202L
143+
# error "__cpp_lib_ranges_to_container should have the value 202202L in c++2b"
144+
# endif
145+
# else // _LIBCPP_VERSION
146+
# ifdef __cpp_lib_ranges_to_container
147+
# error "__cpp_lib_ranges_to_container should not be defined because it is unimplemented in libc++!"
148+
# endif
149+
# endif
150+
121151
#endif // TEST_STD_VER > 20
122152

123153
int main(int, char**) { return 0; }

0 commit comments

Comments
 (0)