$NetBSD: patch-ext_json11_json11.cpp,v 1.1 2017/05/22 23:41:22 joerg Exp $ Clang rejects ordering relations for nullptr, so introduce a template indirection. --- ext/json11/json11.cpp.orig 2016-12-29 12:45:46.000000000 +0000 +++ ext/json11/json11.cpp @@ -132,6 +132,13 @@ void Json::dump(string &out) const { * Value wrappers */ +template bool json11_less(T a, T b) { + return a < b; +} +template <> bool json11_less(const std::nullptr_t a, const std::nullptr_t b) { + return false; +} + template class Value : public JsonValue { protected: @@ -150,7 +157,7 @@ protected: return m_value == static_cast *>(other)->m_value; } bool less(const JsonValue * other) const override { - return m_value < static_cast *>(other)->m_value; + return json11_less(m_value, static_cast *>(other)->m_value); } const T m_value;