martinus / robin-hood-hashing

Fast & memory efficient hashtable based on robin hood hashing for C++11/14/17/20
https://gitter.im/martinus/robin-hood-hashing
MIT License
1.5k stars 142 forks source link

Build error on macOS 10.14.6 #93

Closed phprus closed 3 years ago

phprus commented 3 years ago

Compiler:

/usr/local/opt/llvm/bin/clang++ --version
clang version 10.0.0
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

Error:

In file included from /.../3rdparty/robin-hood-hashing/src/src/external_cmake/myproject.cpp:2:
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:945:16: error: call to 'hash_int' is ambiguous
        return hash_int(static_cast<size_t>(result));
               ^~~~~~~~
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:909:15: note: candidate function
inline size_t hash_int(uint64_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:926:15: note: candidate function
inline size_t hash_int(uint32_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:968:16: error: call to 'hash_int' is ambiguous
        return hash_int(reinterpret_cast<size_t>(ptr));
               ^~~~~~~~
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:909:15: note: candidate function
inline size_t hash_int(uint64_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:926:15: note: candidate function
inline size_t hash_int(uint32_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:975:16: error: call to 'hash_int' is ambiguous
        return hash_int(reinterpret_cast<size_t>(ptr.get()));
               ^~~~~~~~
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:909:15: note: candidate function
inline size_t hash_int(uint64_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:926:15: note: candidate function
inline size_t hash_int(uint32_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:982:16: error: call to 'hash_int' is ambiguous
        return hash_int(reinterpret_cast<size_t>(ptr.get()));
               ^~~~~~~~
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:909:15: note: candidate function
inline size_t hash_int(uint64_t x) noexcept {
              ^
/.../3rdparty/robin-hood-hashing/src/src/include/robin_hood.h:926:15: note: candidate function
inline size_t hash_int(uint32_t x) noexcept {
              ^
4 errors generated.
martinus commented 3 years ago

Hi, thanks for the report! I've added a target to the travis build and can reproduce this. Working on it

martinus commented 3 years ago

Can you try the latest commit d6ef9e96c552000ed854fbbb695fd7b125a9a26f, this seems to work

phprus commented 3 years ago

It works now on macOS.

And, a small notice... Symlink compile_commands.json in project root directory is a link to non-existent file build/x/compile_commands.json

martinus commented 3 years ago

thats' great, and I've removed the symlink too