mirror of
https://github.com/nlohmann/json.git
synced 2026-07-23 10:54:53 +00:00
is_comparable used a flat && chain to both exclude json_pointer/string comparisons (added for #4621) and check whether Compare(A, B) is well-formed. Naming std::is_constructible<decltype(...)> as a later operand of that chain still causes the decltype to be substituted regardless of the first operand's value, since the operands aren't lazily deferred like std::conjunction would defer them. That instantiates the transparent std::equal_to<>::operator() used by ordered_json, whose noexcept-specifier evaluates the deprecated json_pointer/string operator==, which Clang (unlike GCC in this case) warns about even though the result is discarded. Split is_comparable so the Compare(A, B) checks live in a separate helper that is only referenced from the specialization selected when is_json_pointer_of is false, so the decltype is never written when A/B are a json_pointer/string pair, regardless of compiler. Signed-off-by: Niels Lohmann <niels.lohmann@gmail.com>