Skip to content

[libc++] Guard transitive include of <locale> with availability macro #95686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

var-const
Copy link
Member

This is a follow-up to #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>.

This is a follow-up to llvm#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>`.
@var-const var-const requested a review from a team as a code owner June 16, 2024 03:14
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jun 16, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 16, 2024

@llvm/pr-subscribers-libcxx

Author: Konstantin Varlamov (var-const)

Changes

This is a follow-up to #80282.
The transitive includes of &lt;locale&gt; in &lt;vector&gt; 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 &lt;vector&gt;.


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

1 Files Affected:

  • (modified) libcxx/include/vector (+2)
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>

@ldionne
Copy link
Member

ldionne commented Jun 17, 2024

LGTM, CI failure is unrelated.

@ldionne ldionne merged commit 0cfdce8 into llvm:main Jun 17, 2024
55 of 56 checks passed
var-const added a commit that referenced this pull request Jul 8, 2024
var-const added a commit to var-const/llvm-project that referenced this pull request Jul 17, 2024
blueboxd pushed a commit to blueboxd/libcxx that referenced this pull request Apr 19, 2025
…ro (#97869)

This is a follow-up to llvm/llvm-project#85521,
similar to llvm/llvm-project#95686.

NOKEYCHECK=True
GitOrigin-RevId: 5789ee28772d942da113762f45fa5f47996b55d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants