From 2ce370c957296b8a9bbde0d0bae98b9f85f3e36e Mon Sep 17 00:00:00 2001 From: Thomas Anderson Date: Thu, 13 Jun 2019 22:27:24 +0000 Subject: [PATCH] [libc++] Fix build with gcc 4.8 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 --- libcxx/include/charconv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/include/charconv b/libcxx/include/charconv index 4e84ef685236..a644fe094846 100644 --- a/libcxx/include/charconv +++ b/libcxx/include/charconv @@ -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