[libcxx-commits] [libcxx] Guard an include of `<ostream>` in `<chrono>` with availability macro (PR #108429)

Konstantin Varlamov via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 12 10:25:35 PDT 2024


https://github.com/var-const created https://github.com/llvm/llvm-project/pull/108429

This fixes a regression introduced in
https://github.com/llvm/llvm-project/pull/96035.


>From ec2d69fb89f3bb651e0204c14f510dd01442517a Mon Sep 17 00:00:00 2001
From: Konstantin Varlamov <varconst at apple.com>
Date: Thu, 12 Sep 2024 10:23:07 -0700
Subject: [PATCH] Guard an include of `<ostream>` in `<chrono>` with
 availability macro

This fixes a regression introduced in
https://github.com/llvm/llvm-project/pull/96035.
---
 libcxx/include/chrono | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/chrono b/libcxx/include/chrono
index 990c415ec2e972..7bec5e5a26ef4a 100644
--- a/libcxx/include/chrono
+++ b/libcxx/include/chrono
@@ -1015,8 +1015,8 @@ constexpr chrono::year                                  operator ""y(unsigned lo
 #  include <charconv>
 #  if !defined(_LIBCPP_HAS_NO_LOCALIZATION)
 #    include <locale>
+#    include <ostream>
 #  endif
-#  include <ostream>
 #endif
 
 #endif // _LIBCPP_CHRONO



More information about the libcxx-commits mailing list