[libcxx-commits] [libcxx] [libc++] Guard transitive include of `<locale>` with availability macro (PR #97869)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 5 17:59:06 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Konstantin Varlamov (var-const)

<details>
<summary>Changes</summary>

This is a follow-up to https://github.com/llvm/llvm-project/pull/85521,
similar to https://github.com/llvm/llvm-project/pull/95686.


---
Full diff: https://github.com/llvm/llvm-project/pull/97869.diff


1 Files Affected:

- (modified) libcxx/include/chrono (+3-1) 


``````````diff
diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index c66771ffbad1a..23441ddb23986 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -996,7 +996,9 @@ constexpr chrono::year                                  operator ""y(unsigned lo
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER == 20
 #  include <charconv>
-#  include <locale>
+#  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
+#    include <locale>
+#  endif
 #  include <ostream>
 #endif
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/97869


More information about the libcxx-commits mailing list