Compiling with clang (v. 5.0.0, x84_64 linux) with JSON_NOEXCEPTION defined produces error
/path/to/include/nlohmann/detail/conversions/from_json.hpp:31:9: error: no member named 'abort' in namespace 'std'; did you mean simply 'abort'?
JSON_THROW(type_error::create(302, "type must be null, but is " + std::string(j.type_name())));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/include/nlohmann/detail/macro_scope.hpp:47:35: note: expanded from macro 'JSON_THROW'
#define JSON_THROW(exception) std::abort()
This is because std::abort is defined in <cstdlib> and nowhere does this library include <cstdlib>.
I don't have a MWE to hand, this error was discovered using the Unreal build tool on Linux, which may be passing some unconventional arguments to clang and I don't have time right now to find the reproduction steps. In any case, <cstdlib> should be included when std::abort is being used.
Compiling with clang (v. 5.0.0, x84_64 linux) with
JSON_NOEXCEPTIONdefined produces errorThis is because
std::abortis defined in<cstdlib>and nowhere does this library include<cstdlib>.I don't have a MWE to hand, this error was discovered using the Unreal build tool on Linux, which may be passing some unconventional arguments to clang and I don't have time right now to find the reproduction steps. In any case,
<cstdlib>should be included whenstd::abortis being used.