Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UTIL: Add workaround for libc++ for util::strings::convert<double>()
Behavior of parsing doubles from streams is different in LLVM's libc++ compared to GCC's libstdc++, see [1]. This causes StringTest.StringConversionTest to fail when compiling against LLVM's libc++: [ RUN ] StringTest.StringConversionTest util/gtest_string.cc:48: Failure Expected equality of these values: 10.1234 util::string::convert<double>("10.1234asfd", false) Which is: 0 [ FAILED ] StringTest.StringConversionTest (0 ms) This mainly affects macOS because it defaults to libc++. The behavior of libstdc++ is what makes most sense here because std::stringstream::operator>>() will call std::strtod() internally which will extract 10.1234 from the string. This is fixed by implementing a workaround for libc++. [1] https://www.github.com/llvm/llvm-project/issues/18156
- Loading branch information