[PATCH] D60043: [FileCheck] Fix FileCheck.cpp compilation on Solaris
James Y Knight via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 1 08:28:04 PDT 2019
jyknight added a comment.
Sounds like this file is missing #include <math.h> (it probably only #include <cmath>). If it wants to use ::log10, it should #include <math.h>. If it wants to use <cmath>, it should use std::log10.
Ideally, this wouldn't cause this sort of error, but see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89855 which I just filed recently about this problem -- although I didn't know it affected llvm!
Why this is broken only in solaris -- in solaris libc, the LIBC math.h header itself defines the overloads for float, and long double in C++ (in addition to the usual C double). But, they do not define the C++11 "any-int-type" overload. Thus, you get the ambiguous overloads resulting from this GCC bug only on solaris. On other platforms, you just see only the double overload. Which in this instance is fine, but if you were passing a float or long double, may not be!
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60043/new/
https://reviews.llvm.org/D60043
More information about the llvm-commits
mailing list