Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous compare operators with clang-5.0 #547

Closed
pboettch opened this issue Apr 5, 2017 · 4 comments
Closed

Ambiguous compare operators with clang-5.0 #547

pboettch opened this issue Apr 5, 2017 · 4 comments
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead

Comments

@pboettch
Copy link
Contributor

pboettch commented Apr 5, 2017

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).

@nlohmann
Copy link
Owner

nlohmann commented Apr 5, 2017

Could this be a duplicate of #512?

@pboettch
Copy link
Contributor Author

pboettch commented Apr 5, 2017

It is. Sorry for not checking the existing issues.

@nlohmann
Copy link
Owner

nlohmann commented Apr 5, 2017

No problem, thanks for reporting anyway! I unfortunately did not find the time to fix it. I'm using Clang 5 myself, but did not run into this issue myself.

@nlohmann nlohmann closed this as completed Apr 5, 2017
@nlohmann nlohmann added the solution: duplicate the issue is a duplicate; refer to the linked issue instead label Apr 5, 2017
@nlohmann
Copy link
Owner

nlohmann commented Apr 7, 2017

Fixed, see #512.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution: duplicate the issue is a duplicate; refer to the linked issue instead
Projects
None yet
Development

No branches or pull requests

2 participants