Skip to content

Commit

Permalink
[libc++] Fix build with gcc 4.8
Browse files Browse the repository at this point in the history
gcc 4.8.4 (but not 5.4.0 or 7.3.0) has trouble initializing errc with {}, giving
the error in [1]. This CL switches to explicitly using errc(0), which gcc 4.8
accepts.

[1] https://bugs.chromium.org/p/chromium/issues/detail?id=973723

Differential Revision: https://reviews.llvm.org/D63296

llvm-svn: 363333
  • Loading branch information
tanderson-google committed Jun 13, 2019
1 parent 4336a94 commit 2ce370c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libcxx/include/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ __to_chars_itoa(char* __first, char* __last, _Tp __value, false_type)

#if !defined(_LIBCPP_COMPILER_MSVC)
if (__tx::digits <= __diff || __tx::__width(__value) <= __diff)
return {__tx::__convert(__value, __first), {}};
return {__tx::__convert(__value, __first), errc(0)};
else
return {__last, errc::value_too_large};
#else
Expand Down

0 comments on commit 2ce370c

Please sign in to comment.