[libcxx-commits] [libcxx] r363333 - [libc++] Fix build with gcc 4.8

Thomas Anderson via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 13 15:27:24 PDT 2019


Author: thomasanderson
Date: Thu Jun 13 15:27:24 2019
New Revision: 363333

URL: http://llvm.org/viewvc/llvm-project?rev=363333&view=rev
Log:
[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

Modified:
    libcxx/trunk/include/charconv

Modified: libcxx/trunk/include/charconv
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/charconv?rev=363333&r1=363332&r2=363333&view=diff
==============================================================================
--- libcxx/trunk/include/charconv (original)
+++ libcxx/trunk/include/charconv Thu Jun 13 15:27:24 2019
@@ -314,7 +314,7 @@ __to_chars_itoa(char* __first, char* __l
 
 #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




More information about the libcxx-commits mailing list