summaryrefslogtreecommitdiff
path: root/libcxxabi
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2025-01-28 16:44:57 -0500
committerGitHub <noreply@github.com>2025-01-28 16:44:57 -0500
commita06c89387621b0a040e6203e7f1a2d8243f5be33 (patch)
treed29d864f9333f2ef43595350fd5734651c339957 /libcxxabi
parente89e7c4685aa673173220eace7a0a8b64dbd2391 (diff)
[libc++abi] Make once_flag constinit in cxa_exception_storage (#124627)
This makes it clearer that initialization of this global variable is taking place at compile-time, reducing the likelihood of static initialization order fiasco.
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/cxa_exception_storage.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxxabi/src/cxa_exception_storage.cpp b/libcxxabi/src/cxa_exception_storage.cpp
index 733f0d470569..05da6a48e313 100644
--- a/libcxxabi/src/cxa_exception_storage.cpp
+++ b/libcxxabi/src/cxa_exception_storage.cpp
@@ -56,7 +56,7 @@ extern "C" {
namespace __cxxabiv1 {
namespace {
std::__libcpp_tls_key key_;
- std::__libcpp_exec_once_flag flag_ = _LIBCPP_EXEC_ONCE_INITIALIZER;
+ constinit std::__libcpp_exec_once_flag flag_ = _LIBCPP_EXEC_ONCE_INITIALIZER;
void _LIBCPP_TLS_DESTRUCTOR_CC destruct_(void *p) {
__free_with_fallback(p);