[libcxx-commits] [libcxx] [libc++] Work around benign initialization order fiasco in locale (PR #73533)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 27 08:07:03 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 63a6e51f8ad68a1f573b3a278486124c0ade8711 8484ff20ad032812ffbc46bfe6d769ddba0a5acf -- libcxx/include/__utility/no_destroy.h libcxx/src/locale.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index d6ba490a00..5bd53d99ca 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -546,7 +546,8 @@ locale::__imp::use_facet(long id) const
// expensive in parallel applications. The classic locale is used by default
// in all streams. Note: if a new global locale is installed, then we lose
// the benefit of no reference counting.
-constinit __no_destroy<locale::__imp> locale::__imp::classic_locale_imp_(__uninitialized_tag{}); // initialized below in classic()
+constinit __no_destroy<locale::__imp>
+ locale::__imp::classic_locale_imp_(__uninitialized_tag{}); // initialized below in classic()
const locale& locale::classic() {
static const __no_destroy<locale> classic_locale(__private_tag{}, [] {
``````````
</details>
https://github.com/llvm/llvm-project/pull/73533
More information about the libcxx-commits
mailing list