<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">See<div class=""><br class=""></div><div class=""><a href="https://trac.macports.org/ticket/62770" class="">https://trac.macports.org/ticket/62770</a></div><div class=""><br class=""></div><div class="">Its the macOS11.3 / Xcode 12.5 update, it has broken all MacPorts clang versions <= 11</div><div class=""><br class=""></div><div class="">At this time the only macports clang that works is the clang-level port.</div><div class=""><br class=""></div><div class="">Chris</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 3 May 2021, at 1:14 pm, Andrew Udvare <<a href="mailto:audvare@gmail.com" class="">audvare@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">This code compiles fine with Xcode but fails with Clang from MacPorts. I have not been able to figure out why. I successfully rebuilt Clang and LLVM from source but it made no difference.<br class=""><br class="">Setup:<br class=""><br class="">macOS 11.3 20E232 x86_64<br class="">Xcode 12.5 12E262<br class=""><br class="">The code (main.cpp):<br class=""><br class="">#include <filesystem><br class="">int main(int argc, char *argv[]) {<br class=""> std::filesystem::path p(argv[0]);<br class=""> return p.string().length();<br class="">}<br class=""><br class=""> $ xcrun clang++ -std=c++17 main.cpp<br class=""># No errors<br class=""><br class="">Anyone know why it would fail with MacPorts' Clang? Seems to be an include path/file issue.<br class=""><br class=""> $ /opt/local/bin/clang++-mp-11 -std=c++17 main.cpp -ferror-limit=2<br class="">In file included from main.cpp:1:<br class="">In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/filesystem:234:<br class="">In file included from /opt/local/libexec/llvm-11/bin/../include/c++/v1/cstdlib:85:<br class="">/opt/local/libexec/llvm-11/bin/../include/c++/v1/stdlib.h:142:34: error: unknown type name 'ldiv_t'<br class="">inline _LIBCPP_INLINE_VISIBILITY ldiv_t div(long __x, long __y) _NOEXCEPT {<br class=""> ^<br class="">/opt/local/libexec/llvm-11/bin/../include/c++/v1/stdlib.h:143:12: error: no member named 'ldiv' in the global namespace<br class=""> return ::ldiv(__x, __y);<br class=""> ~~^<br class="">fatal error: too many errors emitted, stopping now [-ferror-limit=]<br class="">3 errors generated.<br class=""><br class="">This generates a lot of errors that are members are missing from the global namespace.<br class=""><br class="">This affects this port I have had working for a while, probably by accident because it wasn't until recently that Xcode Clang and MacPorts Clang versions mismatched their highest numbers (Xcode 12.5 having Clang 12, MacPorts having up to 11).<br class=""><br class=""><a href="https://github.com/Tatsh/ports/blob/ycm-fixes/devel/ycmd/Portfile" class="">https://github.com/Tatsh/ports/blob/ycm-fixes/devel/ycmd/Portfile</a><br class=""><br class="">This project tries to compile this code within CMake to test for required arguments, but it's failing for the reason above rather than actually missing filesystem implementation. See https://github.com/ycm-core/ycmd/blob/master/cpp/ycm/CMakeLists.txt#L279<br class=""><br class="">-- <br class="">Andrew Udvare<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>