Apple Clang 14.0 lacks support for std::is_eq #29918

issue hebasto openend this issue on April 19, 2024
  1. hebasto commented at 11:44 pm on April 19, 2024: member
     0% cat test.cpp                   
     1#include <compare>
     2
     3int main()
     4{
     5  double foo = -0.0;
     6  double bar = 0.0;
     7  return std::is_eq(foo <=> bar);
     8}
     9% clang++ -std=c++20 test.cpp        
    10test.cpp:7:15: error: no member named 'is_eq' in namespace 'std'
    11  return std::is_eq(foo <=> bar);
    12         ~~~~~^
    131 error generated.
    14% clang -v                           
    15Apple clang version 14.0.0 (clang-1400.0.29.202)
    16Target: x86_64-apple-darwin21.6.0
    17Thread model: posix
    18InstalledDir: /Library/Developer/CommandLineTools/usr/bin
    

    https://developer.apple.com/xcode/cpp/#c++20 didn’t help much.

    std::is_eq were added in #29242.

  2. hebasto added the label macOS on Apr 19, 2024
  3. fanquake commented at 5:40 am on April 20, 2024: member
    We’ll be dropping support for this compiler as soon as oss-fuzz rolls their Clang, and we bump our minimum.
  4. furszy commented at 1:14 pm on April 20, 2024: member
    Faced this too. Updating to 14.0.3 fixes the problem.
  5. hebasto commented at 4:08 pm on April 20, 2024: member

    Faced this too. Updating to 14.0.3 fixes the problem.

    Well, that’s actually means switching to the toolchain based on LLVM 15.

  6. hebasto commented at 8:06 pm on April 20, 2024: member

    @furszy

    Faced this too. Updating to 14.0.3 fixes the problem.

    Just to clarify, what macOS version did you update your clang on?

  7. furszy commented at 11:03 pm on April 20, 2024: member
    Ventura 13.1.
  8. hebasto commented at 11:09 pm on April 20, 2024: member

    Ventura 13.1.

    Well. It seems Apple does not suggest any upgrade paths for Big Sur and Monterey, which are still supported platforms for Bitcoin Core 27.0.

  9. maflcko added the label Build system on Apr 21, 2024
  10. maflcko commented at 8:32 am on April 21, 2024: member

    supported platforms

    My understanding is that you can run Bitcoin Core on those platforms. However, compiling Bitcoin Core from source may not work out of the box.

    If macOS does not offer an upgrade path for the system compiler, can you try to use a compiler provided by brew?

    Another alternative would be to compile the compiler you need yourself.

  11. maflcko commented at 8:49 am on April 21, 2024: member

    Faced this too. Updating to 14.0.3 fixes the problem.

    Just to clarify the confusing versioning here, this corresponds to Xcode 14.3, llvm 15, and Apple Clang 14.0.3, according to https://en.wikipedia.org/wiki/Xcode#Xcode_11.0_-_14.x_%28since_SwiftUI_framework%29

  12. fanquake commented at 11:17 am on April 21, 2024: member
    Yea. I think this can be closed with “use a compiler that better supports C++20”. We still support the mentioned systems, and as far as I’m aware, installing and using a newer compiler would also work fine.
  13. Sjors commented at 10:43 am on April 22, 2024: member
    I was going to suggest changing doc/dependencies.md to clarify the minimum clang version is 14.0.3 rather than 14.0, but #29165 bumps it to 15.0 anyway.
  14. maflcko commented at 10:59 am on April 22, 2024: member

    I was going to suggest changing doc/dependencies.md to clarify the minimum clang version is 14.0.3 rather than 14.0, but #29165 bumps it to 15.0 anyway.

    That would not be accurate. Clang 14 is indeed supported, see also https://godbolt.org/z/61seKv74b

    The problem here is that Apple Clang 14.0.0 is apparently not based on llvm 14.0.0. I don’t have further insights into Apples versioning nonsense, so I can’t help here.

  15. maflcko added the label Upstream on Apr 22, 2024
  16. Sjors commented at 11:04 am on April 22, 2024: member
    I see, so Apple clang needs to be >=14.0.3, but for other operating systems 14.0 is fine.
  17. fanquake referenced this in commit 9d1a286f20 on May 2, 2024
  18. maflcko commented at 1:34 pm on May 7, 2024: member
    Anything left to be done here?
  19. maflcko closed this on May 7, 2024


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-28 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me