Skip to content

Commit b233c5f

Browse files
authored
[libc++] Fix use of std::errc() for C++ < 11 (#138522)
After 8fc2538 "Reapply '[libc++] Optimize num_put integral functions' (#131613) (#133572)", including <locale> in C++03 mode with Debug hardening enabled fails. This patch fixes that by applying a workaround used elsewhere to construct errc in C++03 mode.
1 parent 8d7b35e commit b233c5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libcxx/include/locale

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ _LIBCPP_HIDE_FROM_ABI inline _OutputIterator num_put<_CharT, _OutputIterator>::_
12771277
}
12781278

12791279
auto __res = std::__to_chars_integral(__buffer_ptr, __char_buffer + __buffer_size, __uval, __base);
1280-
_LIBCPP_ASSERT_INTERNAL(__res.__ec == std::errc(), "to_chars: invalid maximum buffer size computed?");
1280+
_LIBCPP_ASSERT_INTERNAL(__res.__ec == std::errc(0), "to_chars: invalid maximum buffer size computed?");
12811281

12821282
// Make letters uppercase
12831283
if (__flags & ios_base::hex && __flags & ios_base::uppercase) {

0 commit comments

Comments
 (0)