Skip to content

Commit 2207e3e

Browse files
[libc++] Set feature-test macro __cpp_lib_atomic_float (#127559)
The corresponding feature was implemented in LLVM 18 (by #67799), but this FTM wasn't added before.
1 parent 61cfa53 commit 2207e3e

File tree

6 files changed

+33
-70
lines changed

6 files changed

+33
-70
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Status
174174
---------------------------------------------------------- -----------------
175175
``__cpp_lib_atomic_flag_test`` ``201907L``
176176
---------------------------------------------------------- -----------------
177-
``__cpp_lib_atomic_float`` *unimplemented*
177+
``__cpp_lib_atomic_float`` ``201711L``
178178
---------------------------------------------------------- -----------------
179179
``__cpp_lib_atomic_lock_free_type_aliases`` ``201907L``
180180
---------------------------------------------------------- -----------------

libcxx/docs/Status/Cxx20Papers.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"`P0463R1 <https://wg21.link/P0463R1>`__","Endian just Endian","2017-07 (Toronto)","|Complete|","7",""
33
"`P0674R1 <https://wg21.link/P0674R1>`__","Extending make_shared to Support Arrays","2017-07 (Toronto)","|Complete|","15",""
44
"","","","","",""
5-
"`P0020R6 <https://wg21.link/P0020R6>`__","Floating Point Atomic","2017-11 (Albuquerque)","|Complete|","18",""
5+
"`P0020R6 <https://wg21.link/P0020R6>`__","Floating Point Atomic","2017-11 (Albuquerque)","|Complete|","18","The feature-test macro was not set until LLVM 20."
66
"`P0053R7 <https://wg21.link/P0053R7>`__","C++ Synchronized Buffered Ostream","2017-11 (Albuquerque)","|Complete|","18",""
77
"`P0202R3 <https://wg21.link/P0202R3>`__","Add constexpr modifiers to functions in <algorithm> and <utility> Headers","2017-11 (Albuquerque)","|Complete|","12",""
88
"`P0415R1 <https://wg21.link/P0415R1>`__","Constexpr for ``std::complex``\ ","2017-11 (Albuquerque)","|Complete|","16",""

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ __cpp_lib_void_t 201411L <type_traits>
378378
# define __cpp_lib_array_constexpr 201811L
379379
# define __cpp_lib_assume_aligned 201811L
380380
# define __cpp_lib_atomic_flag_test 201907L
381-
// # define __cpp_lib_atomic_float 201711L
381+
# define __cpp_lib_atomic_float 201711L
382382
# define __cpp_lib_atomic_lock_free_type_aliases 201907L
383383
# define __cpp_lib_atomic_ref 201806L
384384
// # define __cpp_lib_atomic_shared_ptr 201711L

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

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -169,17 +169,11 @@
169169
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
170170
# endif
171171

172-
# if !defined(_LIBCPP_VERSION)
173-
# ifndef __cpp_lib_atomic_float
174-
# error "__cpp_lib_atomic_float should be defined in c++20"
175-
# endif
176-
# if __cpp_lib_atomic_float != 201711L
177-
# error "__cpp_lib_atomic_float should have the value 201711L in c++20"
178-
# endif
179-
# else // _LIBCPP_VERSION
180-
# ifdef __cpp_lib_atomic_float
181-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
182-
# endif
172+
# ifndef __cpp_lib_atomic_float
173+
# error "__cpp_lib_atomic_float should be defined in c++20"
174+
# endif
175+
# if __cpp_lib_atomic_float != 201711L
176+
# error "__cpp_lib_atomic_float should have the value 201711L in c++20"
183177
# endif
184178

185179
# ifndef __cpp_lib_atomic_is_always_lock_free
@@ -262,17 +256,11 @@
262256
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
263257
# endif
264258

265-
# if !defined(_LIBCPP_VERSION)
266-
# ifndef __cpp_lib_atomic_float
267-
# error "__cpp_lib_atomic_float should be defined in c++23"
268-
# endif
269-
# if __cpp_lib_atomic_float != 201711L
270-
# error "__cpp_lib_atomic_float should have the value 201711L in c++23"
271-
# endif
272-
# else // _LIBCPP_VERSION
273-
# ifdef __cpp_lib_atomic_float
274-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
275-
# endif
259+
# ifndef __cpp_lib_atomic_float
260+
# error "__cpp_lib_atomic_float should be defined in c++23"
261+
# endif
262+
# if __cpp_lib_atomic_float != 201711L
263+
# error "__cpp_lib_atomic_float should have the value 201711L in c++23"
276264
# endif
277265

278266
# ifndef __cpp_lib_atomic_is_always_lock_free
@@ -355,17 +343,11 @@
355343
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
356344
# endif
357345

358-
# if !defined(_LIBCPP_VERSION)
359-
# ifndef __cpp_lib_atomic_float
360-
# error "__cpp_lib_atomic_float should be defined in c++26"
361-
# endif
362-
# if __cpp_lib_atomic_float != 201711L
363-
# error "__cpp_lib_atomic_float should have the value 201711L in c++26"
364-
# endif
365-
# else // _LIBCPP_VERSION
366-
# ifdef __cpp_lib_atomic_float
367-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
368-
# endif
346+
# ifndef __cpp_lib_atomic_float
347+
# error "__cpp_lib_atomic_float should be defined in c++26"
348+
# endif
349+
# if __cpp_lib_atomic_float != 201711L
350+
# error "__cpp_lib_atomic_float should have the value 201711L in c++26"
369351
# endif
370352

371353
# ifndef __cpp_lib_atomic_is_always_lock_free

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
@@ -3282,17 +3282,11 @@
32823282
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20"
32833283
# endif
32843284

3285-
# if !defined(_LIBCPP_VERSION)
3286-
# ifndef __cpp_lib_atomic_float
3287-
# error "__cpp_lib_atomic_float should be defined in c++20"
3288-
# endif
3289-
# if __cpp_lib_atomic_float != 201711L
3290-
# error "__cpp_lib_atomic_float should have the value 201711L in c++20"
3291-
# endif
3292-
# else // _LIBCPP_VERSION
3293-
# ifdef __cpp_lib_atomic_float
3294-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
3295-
# endif
3285+
# ifndef __cpp_lib_atomic_float
3286+
# error "__cpp_lib_atomic_float should be defined in c++20"
3287+
# endif
3288+
# if __cpp_lib_atomic_float != 201711L
3289+
# error "__cpp_lib_atomic_float should have the value 201711L in c++20"
32963290
# endif
32973291

32983292
# ifndef __cpp_lib_atomic_is_always_lock_free
@@ -4707,17 +4701,11 @@
47074701
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23"
47084702
# endif
47094703

4710-
# if !defined(_LIBCPP_VERSION)
4711-
# ifndef __cpp_lib_atomic_float
4712-
# error "__cpp_lib_atomic_float should be defined in c++23"
4713-
# endif
4714-
# if __cpp_lib_atomic_float != 201711L
4715-
# error "__cpp_lib_atomic_float should have the value 201711L in c++23"
4716-
# endif
4717-
# else // _LIBCPP_VERSION
4718-
# ifdef __cpp_lib_atomic_float
4719-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
4720-
# endif
4704+
# ifndef __cpp_lib_atomic_float
4705+
# error "__cpp_lib_atomic_float should be defined in c++23"
4706+
# endif
4707+
# if __cpp_lib_atomic_float != 201711L
4708+
# error "__cpp_lib_atomic_float should have the value 201711L in c++23"
47214709
# endif
47224710

47234711
# ifndef __cpp_lib_atomic_is_always_lock_free
@@ -6369,17 +6357,11 @@
63696357
# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26"
63706358
# endif
63716359

6372-
# if !defined(_LIBCPP_VERSION)
6373-
# ifndef __cpp_lib_atomic_float
6374-
# error "__cpp_lib_atomic_float should be defined in c++26"
6375-
# endif
6376-
# if __cpp_lib_atomic_float != 201711L
6377-
# error "__cpp_lib_atomic_float should have the value 201711L in c++26"
6378-
# endif
6379-
# else // _LIBCPP_VERSION
6380-
# ifdef __cpp_lib_atomic_float
6381-
# error "__cpp_lib_atomic_float should not be defined because it is unimplemented in libc++!"
6382-
# endif
6360+
# ifndef __cpp_lib_atomic_float
6361+
# error "__cpp_lib_atomic_float should be defined in c++26"
6362+
# endif
6363+
# if __cpp_lib_atomic_float != 201711L
6364+
# error "__cpp_lib_atomic_float should have the value 201711L in c++26"
63836365
# endif
63846366

63856367
# ifndef __cpp_lib_atomic_is_always_lock_free

libcxx/utils/generate_feature_test_macro_components.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ def add_version_header(tc):
169169
"name": "__cpp_lib_atomic_float",
170170
"values": {"c++20": 201711},
171171
"headers": ["atomic"],
172-
"unimplemented": True,
173172
},
174173
{
175174
"name": "__cpp_lib_atomic_is_always_lock_free",

0 commit comments

Comments
 (0)