Skip to content

Commit e42f760

Browse files
authored
[libc++] Define the __cpp_lib_atomic_ref feature test macro (#98081)
We forgot to enable it when we landed std::atomic_ref in 42ba740.
1 parent baf22a5 commit e42f760

File tree

5 files changed

+32
-69
lines changed

5 files changed

+32
-69
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Status
178178
---------------------------------------------------------- -----------------
179179
``__cpp_lib_atomic_lock_free_type_aliases`` ``201907L``
180180
---------------------------------------------------------- -----------------
181-
``__cpp_lib_atomic_ref`` *unimplemented*
181+
``__cpp_lib_atomic_ref`` ``201806L``
182182
---------------------------------------------------------- -----------------
183183
``__cpp_lib_atomic_shared_ptr`` *unimplemented*
184184
---------------------------------------------------------- -----------------

libcxx/include/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ __cpp_lib_void_t 201411L <type_traits>
366366
# define __cpp_lib_atomic_flag_test 201907L
367367
// # define __cpp_lib_atomic_float 201711L
368368
# define __cpp_lib_atomic_lock_free_type_aliases 201907L
369-
// # define __cpp_lib_atomic_ref 201806L
369+
# define __cpp_lib_atomic_ref 201806L
370370
// # define __cpp_lib_atomic_shared_ptr 201711L
371371
# define __cpp_lib_atomic_value_initialization 201911L
372372
# if _LIBCPP_AVAILABILITY_HAS_SYNC

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
@@ -200,17 +200,11 @@
200200
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
201201
# endif
202202

203-
# if !defined(_LIBCPP_VERSION)
204-
# ifndef __cpp_lib_atomic_ref
205-
# error "__cpp_lib_atomic_ref should be defined in c++20"
206-
# endif
207-
# if __cpp_lib_atomic_ref != 201806L
208-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
209-
# endif
210-
# else // _LIBCPP_VERSION
211-
# ifdef __cpp_lib_atomic_ref
212-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
213-
# endif
203+
# ifndef __cpp_lib_atomic_ref
204+
# error "__cpp_lib_atomic_ref should be defined in c++20"
205+
# endif
206+
# if __cpp_lib_atomic_ref != 201806L
207+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
214208
# endif
215209

216210
# if !defined(_LIBCPP_VERSION)
@@ -299,17 +293,11 @@
299293
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
300294
# endif
301295

302-
# if !defined(_LIBCPP_VERSION)
303-
# ifndef __cpp_lib_atomic_ref
304-
# error "__cpp_lib_atomic_ref should be defined in c++23"
305-
# endif
306-
# if __cpp_lib_atomic_ref != 201806L
307-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
308-
# endif
309-
# else // _LIBCPP_VERSION
310-
# ifdef __cpp_lib_atomic_ref
311-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
312-
# endif
296+
# ifndef __cpp_lib_atomic_ref
297+
# error "__cpp_lib_atomic_ref should be defined in c++23"
298+
# endif
299+
# if __cpp_lib_atomic_ref != 201806L
300+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
313301
# endif
314302

315303
# if !defined(_LIBCPP_VERSION)
@@ -407,17 +395,11 @@
407395
# endif
408396
# endif
409397

410-
# if !defined(_LIBCPP_VERSION)
411-
# ifndef __cpp_lib_atomic_ref
412-
# error "__cpp_lib_atomic_ref should be defined in c++26"
413-
# endif
414-
# if __cpp_lib_atomic_ref != 201806L
415-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
416-
# endif
417-
# else // _LIBCPP_VERSION
418-
# ifdef __cpp_lib_atomic_ref
419-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
420-
# endif
398+
# ifndef __cpp_lib_atomic_ref
399+
# error "__cpp_lib_atomic_ref should be defined in c++26"
400+
# endif
401+
# if __cpp_lib_atomic_ref != 201806L
402+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
421403
# endif
422404

423405
# 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
@@ -3254,17 +3254,11 @@
32543254
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
32553255
# endif
32563256

3257-
# if !defined(_LIBCPP_VERSION)
3258-
# ifndef __cpp_lib_atomic_ref
3259-
# error "__cpp_lib_atomic_ref should be defined in c++20"
3260-
# endif
3261-
# if __cpp_lib_atomic_ref != 201806L
3262-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
3263-
# endif
3264-
# else // _LIBCPP_VERSION
3265-
# ifdef __cpp_lib_atomic_ref
3266-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
3267-
# endif
3257+
# ifndef __cpp_lib_atomic_ref
3258+
# error "__cpp_lib_atomic_ref should be defined in c++20"
3259+
# endif
3260+
# if __cpp_lib_atomic_ref != 201806L
3261+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
32683262
# endif
32693263

32703264
# if !defined(_LIBCPP_VERSION)
@@ -4675,17 +4669,11 @@
46754669
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
46764670
# endif
46774671

4678-
# if !defined(_LIBCPP_VERSION)
4679-
# ifndef __cpp_lib_atomic_ref
4680-
# error "__cpp_lib_atomic_ref should be defined in c++23"
4681-
# endif
4682-
# if __cpp_lib_atomic_ref != 201806L
4683-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
4684-
# endif
4685-
# else // _LIBCPP_VERSION
4686-
# ifdef __cpp_lib_atomic_ref
4687-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
4688-
# endif
4672+
# ifndef __cpp_lib_atomic_ref
4673+
# error "__cpp_lib_atomic_ref should be defined in c++23"
4674+
# endif
4675+
# if __cpp_lib_atomic_ref != 201806L
4676+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
46894677
# endif
46904678

46914679
# if !defined(_LIBCPP_VERSION)
@@ -6318,17 +6306,11 @@
63186306
# endif
63196307
# endif
63206308

6321-
# if !defined(_LIBCPP_VERSION)
6322-
# ifndef __cpp_lib_atomic_ref
6323-
# error "__cpp_lib_atomic_ref should be defined in c++26"
6324-
# endif
6325-
# if __cpp_lib_atomic_ref != 201806L
6326-
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
6327-
# endif
6328-
# else // _LIBCPP_VERSION
6329-
# ifdef __cpp_lib_atomic_ref
6330-
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
6331-
# endif
6309+
# ifndef __cpp_lib_atomic_ref
6310+
# error "__cpp_lib_atomic_ref should be defined in c++26"
6311+
# endif
6312+
# if __cpp_lib_atomic_ref != 201806L
6313+
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
63326314
# endif
63336315

63346316
# 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
@@ -184,7 +184,6 @@ def add_version_header(tc):
184184
"name": "__cpp_lib_atomic_ref",
185185
"values": {"c++20": 201806},
186186
"headers": ["atomic"],
187-
"unimplemented": True,
188187
},
189188
{
190189
"name": "__cpp_lib_atomic_shared_ptr",

0 commit comments

Comments
 (0)