Skip to content

[libc++] In <format>, use availability macro if including <locale> #99274

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

Conversation

var-const
Copy link
Member

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

@var-const var-const requested a review from a team as a code owner July 17, 2024 06:34
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jul 17, 2024
@var-const var-const added the locale issues related to localization label Jul 17, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 17, 2024

@llvm/pr-subscribers-libcxx

Author: Konstantin Varlamov (var-const)

Changes

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


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

1 Files Affected:

  • (modified) libcxx/include/format (+2)
diff --git a/libcxx/include/format b/libcxx/include/format
index 07c2ba083199e..526174762797f 100644
--- a/libcxx/include/format
+++ b/libcxx/include/format
@@ -224,7 +224,9 @@ namespace std {
 #endif
 
 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
+#  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
 #  include <locale>
+#  endif
 #  include <queue>
 #  include <stack>
 #endif

Copy link

github-actions bot commented Jul 17, 2024

✅ With the latest revision this PR passed the C/C++ code formatter.

@ldionne
Copy link
Member

ldionne commented Jul 17, 2024

Is this still really required, since we don't actually issue an error anymore when including <locale> without support for localization?

@var-const var-const marked this pull request as draft July 17, 2024 17:14
@ldionne
Copy link
Member

ldionne commented Jul 19, 2024

Closing since this is not necessary anymore per discussion with @var-const .

@ldionne ldionne closed this Jul 19, 2024
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