Skip to content

Ambiguous compare operators with clang-5.0 #547

@pboettch

Description

@pboettch

This code:

msg["level"] = -80;
if (msg["level"] < -115) {
    ////
}

Gives me a bunch of

error: use of overloaded operator '>=' is ambiguous (with operand types 'int' and 'const value_type' (aka 'const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer>'))

errors when using clang-5.0 (5.0.0-svn294894-1) . Where with gcc 6.3 everything is fine, no moaning.

I know that this version of clang is from the dev-tree (iiuc), but I'm creating this issue to see whether there is something to be done here or on clang's side?

(I'm using 2.1.1 of this library).

Metadata

Metadata

Assignees

No one assigned

    Labels

    solution: duplicatethe issue is a duplicate; refer to the linked issue instead

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions