Nheko-Reborn / mtxclient

Client API library for Matrix, built on top of libcurl
MIT License
40 stars 25 forks source link

Build breaks with nlohmann-json-3.11.1: multiple overloads of 'operator/=' instantiate to the same signature 'nlohmann::json_pointer<unsigned long> &(std::size_t)' #79

Closed yurivict closed 2 years ago

yurivict commented 2 years ago
In file included from /wrkdirs/usr/ports/net-im/mtxclient/work/mtxclient-0.8.0/lib/structs/events/ephemeral/receipt.cpp:1:
In file included from /usr/local/include/nlohmann/json.hpp:50:
/usr/local/include/nlohmann/detail/json_pointer.hpp:116:19: error: multiple overloads of 'operator/=' instantiate to the same signature 'nlohmann::json_pointer<unsigned long> &(std::size_t)' (aka 'nlohmann::json_pointer<unsigned long> &(unsigned long)')
    json_pointer& operator/=(std::size_t array_idx)
                  ^
/wrkdirs/usr/ports/net-im/mtxclient/work/mtxclient-0.8.0/lib/structs/events/ephemeral/receipt.cpp:24:56: note: in instantiation of template class 'nlohmann::json_pointer<unsigned long>' requested here
                  userReceipts.value().value<uint64_t>("ts", 0);
                                                       ^
/wrkdirs/usr/ports/net-im/mtxclient/work/mtxclient-0.8.0/lib/structs/events/ephemeral/receipt.cpp:24:40: note: while substituting deduced template arguments into function template 'value' [with BasicJsonType = unsigned long]
                  userReceipts.value().value<uint64_t>("ts", 0);
                                       ^
/usr/local/include/nlohmann/detail/json_pointer.hpp:108:19: note: previous declaration is here
    json_pointer& operator/=(string_t token)
                  ^
/usr/local/include/nlohmann/detail/json_pointer.hpp:138:25: error: redefinition of 'operator/'
    friend json_pointer operator/(const json_pointer& lhs, std::size_t array_idx)
                        ^
/usr/local/include/nlohmann/detail/json_pointer.hpp:131:25: note: previous definition is here
    friend json_pointer operator/(const json_pointer& lhs, string_t token) // NOLINT(performance-unnecessary-value-param)
                        ^
2 errors generated.

Version: 0.8.0 FreeBSD 13.1

deepbluev7 commented 2 years ago

Upstream bug: https://github.com/nlohmann/json/issues/3655

morguldir commented 2 years ago

This is now fixed in https://github.com/nlohmann/json/releases/tag/v3.11.2

deepbluev7 commented 2 years ago

Yep, thank you!