Skip to content

Commit

Permalink
[libc++] Define the __cpp_lib_atomic_ref feature test macro (#98081)
Browse files Browse the repository at this point in the history
We forgot to enable it when we landed std::atomic_ref in 42ba740.
  • Loading branch information
ldionne authored Jul 9, 2024
1 parent baf22a5 commit e42f760
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 69 deletions.
2 changes: 1 addition & 1 deletion libcxx/docs/FeatureTestMacroTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_atomic_lock_free_type_aliases`` ``201907L``
---------------------------------------------------------- -----------------
``__cpp_lib_atomic_ref`` *unimplemented*
``__cpp_lib_atomic_ref`` ``201806L``
---------------------------------------------------------- -----------------
``__cpp_lib_atomic_shared_ptr`` *unimplemented*
---------------------------------------------------------- -----------------
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/version
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ __cpp_lib_void_t 201411L <type_traits>
# define __cpp_lib_atomic_flag_test 201907L
// # define __cpp_lib_atomic_float 201711L
# define __cpp_lib_atomic_lock_free_type_aliases 201907L
// # define __cpp_lib_atomic_ref 201806L
# define __cpp_lib_atomic_ref 201806L
// # define __cpp_lib_atomic_shared_ptr 201711L
# define __cpp_lib_atomic_value_initialization 201911L
# if _LIBCPP_AVAILABILITY_HAS_SYNC
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,11 @@
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++20"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++20"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down Expand Up @@ -299,17 +293,11 @@
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++23"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++23"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down Expand Up @@ -407,17 +395,11 @@
# endif
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++26"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++26"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3254,17 +3254,11 @@
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++20"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++20"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++20"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down Expand Up @@ -4675,17 +4669,11 @@
# error "__cpp_lib_atomic_min_max should not be defined before c++26"
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++23"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++23"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++23"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down Expand Up @@ -6318,17 +6306,11 @@
# endif
# endif

# if !defined(_LIBCPP_VERSION)
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++26"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
# endif
# else // _LIBCPP_VERSION
# ifdef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should not be defined because it is unimplemented in libc++!"
# endif
# ifndef __cpp_lib_atomic_ref
# error "__cpp_lib_atomic_ref should be defined in c++26"
# endif
# if __cpp_lib_atomic_ref != 201806L
# error "__cpp_lib_atomic_ref should have the value 201806L in c++26"
# endif

# if !defined(_LIBCPP_VERSION)
Expand Down
1 change: 0 additions & 1 deletion libcxx/utils/generate_feature_test_macro_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ def add_version_header(tc):
"name": "__cpp_lib_atomic_ref",
"values": {"c++20": 201806},
"headers": ["atomic"],
"unimplemented": True,
},
{
"name": "__cpp_lib_atomic_shared_ptr",
Expand Down

0 comments on commit e42f760

Please sign in to comment.