🚨 fix compiler warnings #2052

parent be137609
...@@ -862,7 +862,7 @@ class serializer ...@@ -862,7 +862,7 @@ class serializer
: (0xFFu >> type) & (byte); : (0xFFu >> type) & (byte);
std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type); std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
assert(0 <= index and index < 400); assert(index < 400);
state = utf8d[index]; state = utf8d[index];
return state; return state;
} }
......
...@@ -890,9 +890,9 @@ class basic_json ...@@ -890,9 +890,9 @@ class basic_json
struct internal_binary_t : public BinaryType struct internal_binary_t : public BinaryType
{ {
using BinaryType::BinaryType; using BinaryType::BinaryType;
internal_binary_t() : BinaryType() {} internal_binary_t() noexcept(noexcept(BinaryType())) : BinaryType() {}
internal_binary_t(BinaryType const& bint) : BinaryType(bint) {} internal_binary_t(BinaryType const& bint) noexcept(noexcept(BinaryType(bint))) : BinaryType(bint) {}
internal_binary_t(BinaryType&& bint) : BinaryType(std::move(bint)) {} internal_binary_t(BinaryType&& bint) noexcept(noexcept(BinaryType(std::move(bint)))) : BinaryType(std::move(bint)) {}
// TOOD: If minimum C++ version is ever bumped to C++17, this field // TOOD: If minimum C++ version is ever bumped to C++17, this field
// deserves to be a std::optional // deserves to be a std::optional
...@@ -6678,7 +6678,6 @@ class basic_json ...@@ -6678,7 +6678,6 @@ class basic_json
input_format_t format = input_format_t::json, input_format_t format = input_format_t::json,
const bool strict = true) const bool strict = true)
{ {
assert(sax);
return format == input_format_t::json return format == input_format_t::json
? parser(std::move(i)).sax_parse(sax, strict) ? parser(std::move(i)).sax_parse(sax, strict)
: detail::binary_reader<basic_json, SAX>(std::move(i)).sax_parse(format, sax, strict); : detail::binary_reader<basic_json, SAX>(std::move(i)).sax_parse(format, sax, strict);
......
...@@ -15495,7 +15495,7 @@ class serializer ...@@ -15495,7 +15495,7 @@ class serializer
: (0xFFu >> type) & (byte); : (0xFFu >> type) & (byte);
std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type); std::size_t index = 256u + static_cast<size_t>(state) * 16u + static_cast<size_t>(type);
assert(0 <= index and index < 400); assert(index < 400);
state = utf8d[index]; state = utf8d[index];
return state; return state;
} }
...@@ -16377,9 +16377,9 @@ class basic_json ...@@ -16377,9 +16377,9 @@ class basic_json
struct internal_binary_t : public BinaryType struct internal_binary_t : public BinaryType
{ {
using BinaryType::BinaryType; using BinaryType::BinaryType;
internal_binary_t() : BinaryType() {} internal_binary_t() noexcept(noexcept(BinaryType())) : BinaryType() {}
internal_binary_t(BinaryType const& bint) : BinaryType(bint) {} internal_binary_t(BinaryType const& bint) noexcept(noexcept(BinaryType(bint))) : BinaryType(bint) {}
internal_binary_t(BinaryType&& bint) : BinaryType(std::move(bint)) {} internal_binary_t(BinaryType&& bint) noexcept(noexcept(BinaryType(std::move(bint)))) : BinaryType(std::move(bint)) {}
// TOOD: If minimum C++ version is ever bumped to C++17, this field // TOOD: If minimum C++ version is ever bumped to C++17, this field
// deserves to be a std::optional // deserves to be a std::optional
...@@ -22165,7 +22165,6 @@ class basic_json ...@@ -22165,7 +22165,6 @@ class basic_json
input_format_t format = input_format_t::json, input_format_t format = input_format_t::json,
const bool strict = true) const bool strict = true)
{ {
assert(sax);
return format == input_format_t::json return format == input_format_t::json
? parser(std::move(i)).sax_parse(sax, strict) ? parser(std::move(i)).sax_parse(sax, strict)
: detail::binary_reader<basic_json, SAX>(std::move(i)).sax_parse(format, sax, strict); : detail::binary_reader<basic_json, SAX>(std::move(i)).sax_parse(format, sax, strict);
......
...@@ -272,8 +272,8 @@ TEST_CASE("bad my_allocator::construct") ...@@ -272,8 +272,8 @@ TEST_CASE("bad my_allocator::construct")
double, double,
allocator_no_forward>; allocator_no_forward>;
bad_alloc_json json; bad_alloc_json j;
json["test"] = bad_alloc_json::array_t(); j["test"] = bad_alloc_json::array_t();
json["test"].push_back("should not leak"); j["test"].push_back("should not leak");
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment