Skip to content

Commit 7f302f2

Browse files
committed
Revert "[libc++][NFC] Remove __has_keyword"
This reverts commit cd34e89. See https://reviews.llvm.org/D158215#inline-1544266 for details.
1 parent f8843ef commit 7f302f2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

libcxx/include/__config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@
356356
# define __has_declspec_attribute(__x) 0
357357
# endif
358358

359+
# define __has_keyword(__x) !(__is_identifier(__x))
360+
359361
# ifndef __has_include
360362
# define __has_include(...) 0
361363
# endif
@@ -1104,7 +1106,7 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
11041106
# define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
11051107
# endif
11061108

1107-
# if __has_feature(cxx_atomic) || __has_extension(c_atomic)
1109+
# if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
11081110
# define _LIBCPP_HAS_C_ATOMIC_IMP
11091111
# elif defined(_LIBCPP_COMPILER_GCC)
11101112
# define _LIBCPP_HAS_GCC_ATOMIC_IMP

libcxx/include/tuple

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ class __tuple_leaf
308308

309309
template <class _Tp>
310310
static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {
311-
#if __has_builtin(__reference_binds_to_temporary)
311+
#if __has_keyword(__reference_binds_to_temporary)
312312
return !__reference_binds_to_temporary(_Hp, _Tp);
313313
#else
314314
return true;

0 commit comments

Comments
 (0)