Skip to content

Commit 8b73be5

Browse files
committed
[libc++] Readd _LIBCPP_CONSTINIT
This isn't used by libc++, but it's still used in libc++abi.
1 parent 1a9fbf6 commit 8b73be5

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libcxx/.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ AttributeMacros: [
2323
'_LIBCPP_CONSTEXPR_SINCE_CXX20',
2424
'_LIBCPP_CONSTEXPR_SINCE_CXX23',
2525
'_LIBCPP_CONSTEXPR',
26+
'_LIBCPP_CONSTINIT',
2627
'_LIBCPP_DEPRECATED_IN_CXX11',
2728
'_LIBCPP_DEPRECATED_IN_CXX14',
2829
'_LIBCPP_DEPRECATED_IN_CXX17',

libcxx/include/__config

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,14 @@ __sanitizer_verify_double_ended_contiguous_container(const void*, const void*, c
12261226
# define _LIBCPP_THREAD_SAFETY_ANNOTATION(x)
12271227
# endif
12281228

1229+
# if _LIBCPP_STD_VER >= 20
1230+
# define _LIBCPP_CONSTINIT constinit
1231+
# elif __has_attribute(__require_constant_initialization__)
1232+
# define _LIBCPP_CONSTINIT __attribute__((__require_constant_initialization__))
1233+
# else
1234+
# define _LIBCPP_CONSTINIT
1235+
# endif
1236+
12291237
# if __has_attribute(__diagnose_if__) && !defined(_LIBCPP_DISABLE_ADDITIONAL_DIAGNOSTICS)
12301238
# define _LIBCPP_DIAGNOSE_WARNING(...) __attribute__((__diagnose_if__(__VA_ARGS__, "warning")))
12311239
# else

0 commit comments

Comments
 (0)