WPE WebKit 2.27.90 (and most surely the GTK port as well) fail to build with Clang when using libc++ (instead of GNU stdlibc++). Configuration command: CC=clang CXX=clang++ \ LDFLAGS='-stdlib=libc++ -fuse-ld=lld' \ CXXLAGS='-stdlib=libc++' \ cmake -DPORT=WPE -DUSE_LD_GOLD=OFF -DUSE_LD_LLD=ON <...> Build error: ../Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:1155:10: error: no matching function for call to 'isnan' if (!isnan(priv->downloadStartTime)) { ^~~~~ /usr/bin/../include/c++/v1/math.h:535:1: note: candidate function not viable: no known conversion from 'WTF::WallTime' to 'float' for 1st argument isnan(float __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } ^ /usr/bin/../include/c++/v1/math.h:539:1: note: candidate function not viable: no known conversion from 'WTF::WallTime' to 'double' for 1st argument isnan(double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } ^ /usr/bin/../include/c++/v1/math.h:543:1: note: candidate function not viable: no known conversion from 'WTF::WallTime' to 'long double' for 1st argument isnan(long double __lcpp_x) _NOEXCEPT { return __libcpp_isnan(__lcpp_x); } ^ /usr/bin/../include/c++/v1/math.h:521:1: note: candidate template ignored: requirement 'std::is_floating_point<WTF::WallTime>::value' was not satisfied [with _A1 = WTF::WallTime] isnan(_A1 __lcpp_x) _NOEXCEPT ^ /usr/bin/../include/c++/v1/math.h:529:1: note: candidate template ignored: requirement 'std::is_integral<WTF::WallTime>::value' was not satisfied [with _A1 = WTF::WallTime] isnan(_A1) _NOEXCEPT ^ 1 error generated.
This happens in trunk as well. There are “std::isnan()” overloads defined for “WTF::Walltime”, but Clang is being a bit more strict than GCC here and not considering them when using a bare “isnan()“ call (without the namespace) because the overloaded version is inside the namespace, and there us no “using std::isnan;” (or equivalent) anywhere when non-unified builds are disabled. The fix is to add the “std::” namespace prefix to the function call =)
Created attachment 390864 [details] Patch
Comment on attachment 390864 [details] Patch Clearing flags on attachment: 390864 Committed r256706: <https://trac.webkit.org/changeset/256706>
All reviewed patches have been landed. Closing bug.
<rdar://problem/59488736>