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

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jun 15 20:15:29 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/80282.
The transitive includes of `<locale>` in `<vector>` were all guarded by
the availability macro -- the new include should also be guarded,
otherwise any users who compile with localization disabled will start
getting errors trying to include `<vector>`.


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


1 Files Affected:

- (modified) libcxx/include/vector (+2) 


``````````diff
diff --git a/libcxx/include/vector b/libcxx/include/vector
index cbfc2cefa1fd9..c2f541d3fcdb7 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -2974,7 +2974,9 @@ _LIBCPP_POP_MACROS
 #  include <concepts>
 #  include <cstdlib>
 #  include <iosfwd>
+#if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
 #  include <locale>
+#endif
 #  include <tuple>
 #  include <type_traits>
 #  include <typeinfo>

``````````

</details>


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


More information about the libcxx-commits mailing list