Overwork warning flags (#2936)

* ⚗️ update warning flags
This commit is contained in:
Niels Lohmann
2021-08-17 14:43:43 +02:00
committed by GitHub
parent f1e63a8322
commit 8cae9d7cd2
20 changed files with 123 additions and 38 deletions

View File

@@ -358,10 +358,10 @@ TEST_CASE("JSON pointers")
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
}
#if defined(_MSC_VER)
#pragma warning (push)
#pragma warning (disable : 4127) // on some machines, the check below is not constant
#endif
// on some machines, the check below is not constant
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
DOCTEST_MSVC_SUPPRESS_WARNING(4127)
if (sizeof(typename json::size_type) < sizeof(unsigned long long))
{
auto size_type_max_uul = static_cast<unsigned long long>((std::numeric_limits<json::size_type>::max)());
@@ -375,9 +375,7 @@ TEST_CASE("JSON pointers")
CHECK_THROWS_WITH(j_const[jp] == 1, throw_msg.c_str());
}
#if defined(_MSC_VER)
#pragma warning (pop)
#endif
DOCTEST_MSVC_SUPPRESS_WARNING_POP
CHECK_THROWS_AS(j.at("/one"_json_pointer) = 1, json::parse_error&);
CHECK_THROWS_WITH(j.at("/one"_json_pointer) = 1,