Skip to content

Commit b5bc528

Browse files
[libc++] Guard __pad_and_output with _LIBCPP_HAS_LOCALIZATION (#116580)
This fixes errors for no-localization builds (possibly introduced by #116223).
1 parent 4f78f85 commit b5bc528

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

libcxx/include/__iterator/ostreambuf_iterator.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ class _LIBCPP_TEMPLATE_VIS ostreambuf_iterator
6565
_LIBCPP_HIDE_FROM_ABI ostreambuf_iterator& operator++(int) { return *this; }
6666
_LIBCPP_HIDE_FROM_ABI bool failed() const _NOEXCEPT { return __sbuf_ == nullptr; }
6767

68+
#if _LIBCPP_HAS_LOCALIZATION
6869
template <class _Ch, class _Tr>
6970
friend _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_Ch, _Tr> __pad_and_output(
7071
ostreambuf_iterator<_Ch, _Tr> __s, const _Ch* __ob, const _Ch* __op, const _Ch* __oe, ios_base& __iob, _Ch __fl);
72+
#endif // _LIBCPP_HAS_LOCALIZATION
7173
};
7274

7375
_LIBCPP_END_NAMESPACE_STD

libcxx/include/__locale_dir/pad_and_output.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@
1010
#define _LIBCPP___LOCALE_DIR_PAD_AND_OUTPUT_H
1111

1212
#include <__config>
13-
#include <ios>
1413

15-
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16-
# pragma GCC system_header
17-
#endif
14+
#if _LIBCPP_HAS_LOCALIZATION
15+
16+
# include <ios>
17+
18+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
19+
# pragma GCC system_header
20+
# endif
1821

1922
_LIBCPP_BEGIN_NAMESPACE_STD
2023

@@ -80,4 +83,6 @@ _LIBCPP_HIDE_FROM_ABI ostreambuf_iterator<_CharT, _Traits> __pad_and_output(
8083

8184
_LIBCPP_END_NAMESPACE_STD
8285

86+
#endif // _LIBCPP_HAS_LOCALIZATION
87+
8388
#endif // _LIBCPP___LOCALE_DIR_PAD_AND_OUTPUT_H

0 commit comments

Comments
 (0)