Skip to content

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

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

Conversation

var-const
Copy link
Member

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

@var-const var-const requested a review from a team as a code owner July 6, 2024 00:58
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 6, 2024
@var-const var-const changed the title [libc++] Guard transitive include of <locale> with availability macro [libc++] Guard transitive include of <locale> with availability macro Jul 6, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 6, 2024

@llvm/pr-subscribers-libcxx

Author: Konstantin Varlamov (var-const)

Changes

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


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

1 Files Affected:

  • (modified) libcxx/include/chrono (+3-1)
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
 

@var-const var-const added the locale issues related to localization label Jul 6, 2024
Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks LGTM!

@var-const var-const merged commit 5789ee2 into llvm:main Jul 8, 2024
58 checks passed
@var-const var-const deleted the varconst/fix-transitive-locale-include-chrono branch July 8, 2024 05:55
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. locale issues related to localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants