Check for libc++ instead of clang to workaround a libc++ bug. (#3194)

This commit is contained in:
Yichen 2021-04-05 11:24:46 +08:00 committed by GitHub
parent de2e836727
commit 8034a70bd3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -603,7 +603,7 @@ double MathLib::toDoubleNumber(const std::string &str)
// nullcheck // nullcheck
if (isNullValue(str)) if (isNullValue(str))
return 0.0; return 0.0;
#ifdef __clang__ #ifdef _LIBCPP_VERSION
if (isFloat(str)) // Workaround libc++ bug at http://llvm.org/bugs/show_bug.cgi?id=17782 if (isFloat(str)) // Workaround libc++ bug at http://llvm.org/bugs/show_bug.cgi?id=17782
// TODO : handle locale // TODO : handle locale
return std::strtod(str.c_str(), nullptr); return std::strtod(str.c_str(), nullptr);