Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 67cf9b8

Browse files
authored
[libc++] Remove _LIBCPP_CONSTINIT (#171802)
`_LIBCPP_CONSTINIT` is only ever used inside `src/`, so we can just replace it with `constinit` instead.
1 parent 64ecd76 commit 67cf9b8

7 files changed

Lines changed: 6 additions & 15 deletions

File tree

libcxx/.clang-format

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ AttributeMacros: [
2626
'_LIBCPP_CONSTEXPR_SINCE_CXX20',
2727
'_LIBCPP_CONSTEXPR_SINCE_CXX23',
2828
'_LIBCPP_CONSTEXPR',
29-
'_LIBCPP_CONSTINIT',
3029
'_LIBCPP_DEPRECATED_IN_CXX11',
3130
'_LIBCPP_DEPRECATED_IN_CXX14',
3231
'_LIBCPP_DEPRECATED_IN_CXX17',

libcxx/include/__config

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -731,14 +731,6 @@ typedef __char32_t char32_t;
731731
# define _LIBCPP_NO_THREAD_SAFETY_ANALYSIS
732732
# endif
733733

734-
# if _LIBCPP_STD_VER >= 20
735-
# define _LIBCPP_CONSTINIT constinit
736-
# elif __has_attribute(__require_constant_initialization__)
737-
# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
738-
# else
739-
# define _LIBCPP_CONSTINIT
740-
# endif
741-
742734
# if defined(__CUDACC__) || defined(__CUDA_ARCH__) || defined(__CUDA_LIBDEVICE__)
743735
// The CUDA SDK contains an unfortunate definition for the __noinline__ macro,
744736
// which breaks the regular __attribute__((__noinline__)) syntax. Therefore,

libcxxabi/src/cxa_guard_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ struct GlobalStatic {
637637
static T instance;
638638
};
639639
template <class T>
640-
_LIBCPP_CONSTINIT T GlobalStatic<T>::instance = {};
640+
constinit T GlobalStatic<T>::instance = {};
641641

642642
enum class Implementation { NoThreads, GlobalMutex, Futex };
643643

libcxxabi/src/fallback_malloc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ namespace {
3535

3636
// When POSIX threads are not available, make the mutex operations a nop
3737
#ifndef _LIBCXXABI_HAS_NO_THREADS
38-
static _LIBCPP_CONSTINIT std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
38+
static constinit std::__libcpp_mutex_t heap_mutex = _LIBCPP_MUTEX_INITIALIZER;
3939
#else
40-
static _LIBCPP_CONSTINIT void* heap_mutex = 0;
40+
static constinit void* heap_mutex = 0;
4141
#endif
4242

4343
class mutexor {

libcxxabi/test/guard_test_basic.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88
//
9-
// UNSUPPORTED: c++03
9+
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
1010

1111
// Necessary because we include a private header of libc++abi, which
1212
// only understands _LIBCXXABI_HAS_NO_THREADS.

libcxxabi/test/guard_threaded_test.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: c++03
9+
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
1010
// UNSUPPORTED: no-threads
1111
// UNSUPPORTED: no-exceptions
1212

libcxxabi/test/test_fallback_malloc.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <__thread/support.h>
1515

16-
// UNSUPPORTED: c++03
16+
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
1717
// UNSUPPORTED: modules-build && no-threads
1818

1919
// Necessary because we include a private source file of libc++abi, which

0 commit comments

Comments
 (0)