🚨 fix warnings

This commit is contained in:
Niels Lohmann 2022-07-20 15:43:23 +02:00
parent b661022ccd
commit cca872f18f
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
3 changed files with 5 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#endif // JSON_NO_IO
#include <nlohmann/detail/iterators/iterator_traits.hpp>
#include <nlohmann/detail/exceptions.hpp>
#include <nlohmann/detail/macro_scope.hpp>
namespace nlohmann

View File

@ -5910,6 +5910,8 @@ std::size_t hash(const BasicJsonType& j)
// #include <nlohmann/detail/iterators/iterator_traits.hpp>
// #include <nlohmann/detail/exceptions.hpp>
// #include <nlohmann/detail/macro_scope.hpp>

View File

@ -336,7 +336,8 @@ TEST_CASE("deserialization")
SECTION("FILE*")
{
std::FILE* f = std::fopen("nonexisting_file", "r"); // NOTLINT(cppcoreguidelines-owning-memory)
CHECK_THROWS_WITH_AS(json::parse(f), "[json.exception.parse_error.116] parse error: input file is invalid: No such file or directory", json::parse_error&);
json _;
CHECK_THROWS_WITH_AS(_ = json::parse(f), "[json.exception.parse_error.116] parse error: input file is invalid: No such file or directory", json::parse_error&);
}
}