$ make check
make[1]: Entering directory `/home/whackashoe/code/nlohmann-json/test'
[CXX] src/unit-class_parser.o
[CXX] src/unit-comparison.o
[CXX] src/unit-concepts.o
[CXX] src/unit-constructor1.o
src/unit-constructor1.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____42()’:
src/unit-constructor1.cpp:1282:22: warning: ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::basic_json(std::istream&, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; std::istream = std::basic_istream<char>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t = std::function<bool(int, nlohmann::basic_json<>::parse_event_t, nlohmann::basic_json<>&)>]’ is deprecated (declared at ../src/json.hpp:1945) [-Wdeprecated-declarations]
json j(ss);
^
src/unit-constructor1.cpp:1301:14: warning: ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::basic_json(std::istream&, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; std::istream = std::basic_istream<char>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t = std::function<bool(int, nlohmann::basic_json<>::parse_event_t, nlohmann::basic_json<>&)>]’ is deprecated (declared at ../src/json.hpp:1945) [-Wdeprecated-declarations]
});
^
src/unit-constructor1.cpp:1308:21: warning: ‘nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::basic_json(std::istream&, nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; std::istream = std::basic_istream<char>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::parser_callback_t = std::function<bool(int, nlohmann::basic_json<>::parse_event_t, nlohmann::basic_json<>&)>]’ is deprecated (declared at ../src/json.hpp:1945) [-Wdeprecated-declarations]
json j(f);
^
[CXX] src/unit-constructor2.o
[CXX] src/unit-convenience.o
[CXX] src/unit-conversions.o
[CXX] src/unit-deserialization.o
src/unit-deserialization.cpp:82:13: error: stray ‘\’ in program
CHECK("[\"foo\",1,2,3,false,{\"one\":1}]"_json == json({"foo", 1, 2, 3, false, {{"one", 1}}}));
^
src/unit-deserialization.cpp:82:13: error: stray ‘\’ in program
src/unit-deserialization.cpp:123:13: error: stray ‘\’ in program
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:13: error: stray ‘\’ in program
src/unit-deserialization.cpp:124:13: error: stray ‘\’ in program
CHECK_THROWS_WITH("[\"foo\",1,2,3,false,{\"one\":1}"_json,
^
src/unit-deserialization.cpp:124:13: error: stray ‘\’ in program
src/unit-deserialization.cpp: In function ‘void ____C_A_T_C_H____T_E_S_T____36()’:
src/unit-deserialization.cpp:82:203: error: expected primary-expression before ‘(’ token
CHECK("[\"foo\",1,2,3,false,{\"one\":1}]"_json == json({"foo", 1, 2, 3, false, {{"one", 1}}}));
^
src/unit-deserialization.cpp:82:293: error: expected ‘}’ before ‘)’ token
CHECK("[\"foo\",1,2,3,false,{\"one\":1}]"_json == json({"foo", 1, 2, 3, false, {{"one", 1}}}));
^
src/unit-deserialization.cpp:82:294: error: expected ‘]’ before ‘;’ token
CHECK("[\"foo\",1,2,3,false,{\"one\":1}]"_json == json({"foo", 1, 2, 3, false, {{"one", 1}}}));
^
src/unit-deserialization.cpp:123:334: error: expected ‘]’ before ‘;’ token
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:296: error: ambiguous overload for ‘operator[]’ (operand types are ‘nlohmann::json {aka nlohmann::basic_json<>}’ and ‘nlohmann::json {aka nlohmann::basic_json<>}’)
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:296: note: candidates are:
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:3330:15: note: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::size_type) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::reference = nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::size_type = long unsigned int]
reference operator[](size_type idx)
^
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:3378:21: note: const value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::size_type) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::const_reference = const nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::size_type = long unsigned int]
const_reference operator[](size_type idx) const
^
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:3418:15: note: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](const typename nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t::key_type&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::reference = nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>; typename nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t::key_type = std::basic_string<char>]
reference operator[](const typename object_t::key_type& key)
^
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:3469:21: note: const value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](const typename nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t::key_type&) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::const_reference = const nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>; typename nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::object_t::key_type = std::basic_string<char>]
const_reference operator[](const typename object_t::key_type& key) const
^
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:9879:15: note: nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](const nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::json_pointer&) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::reference = nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>]
reference operator[](const json_pointer& ptr)
^
In file included from src/unit-deserialization.cpp:31:0:
../src/json.hpp:9906:21: note: const value_type& nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::operator[](const nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::json_pointer&) const [with ObjectType = std::map; ArrayType = std::vector; StringType = std::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::const_reference = const nlohmann::basic_json<>&; nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType>::value_type = nlohmann::basic_json<>]
const_reference operator[](const json_pointer& ptr) const
^
src/unit-deserialization.cpp:123:334: error: expected ‘]’ before ‘;’ token
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:413: error: expected ‘while’ before ‘(’ token
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:437: error: expected primary-expression before ‘)’ token
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:439: error: expected ‘;’ before ‘{’ token
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:441: error: ‘__catchResult’ was not declared in this scope
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:496: error: expected primary-expression before ‘catch’
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:594: error: expected ‘}’ before ‘else’
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:599: error: ‘__catchResult’ was not declared in this scope
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:656: error: ‘__catchResult’ was not declared in this scope
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:123:713: error: ‘__catchResult’ was not declared in this scope
CHECK_THROWS_AS("[\"foo\",1,2,3,false,{\"one\":1}"_json, std::invalid_argument);
^
src/unit-deserialization.cpp:124:164: error: expected ‘]’ before ‘)’ token
CHECK_THROWS_WITH("[\"foo\",1,2,3,false,{\"one\":1}"_json,
^
src/unit-deserialization.cpp:124:20: error: no match for ‘operator[]’ (operand types are ‘const char [1]’ and ‘nlohmann::json {aka nlohmann::basic_json<>}’)
CHECK_THROWS_WITH("[\"foo\",1,2,3,false,{\"one\":1}"_json,
^
src/unit-deserialization.cpp: At global scope:
src/unit-deserialization.cpp:127:5: error: expected declaration before ‘}’ token
}
^
make[1]: *** [src/unit-deserialization.o] Error 1
Even if I comment this out, I still get more errors:
Using
CXX=clang++ make checkworks fine.