mirror of
https://github.com/nlohmann/json.git
synced 2026-02-26 13:26:28 +00:00
Use DOCTEST_* compiler macros and suppress pragmas warning (#3550)
Use DOCTEST_* macros in place of predefined compiler macros for compiler detection and version checks. The suppression of warning -Wrange-loop-construct in unit-items.cpp causes GCC<11 to warn about pragmas. Suppressed by adding a version check.
This commit is contained in:
committed by
GitHub
parent
87cda1d664
commit
39e27684ea
@@ -803,7 +803,7 @@ TEST_CASE("regression tests 2")
|
||||
const auto j_path = j.get<nlohmann::detail::std_fs::path>();
|
||||
CHECK(j_path == text_path);
|
||||
|
||||
#if defined(__clang__) || ((defined(__GNUC__) && !defined(__INTEL_COMPILER)) && (__GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ >= 4)))
|
||||
#if DOCTEST_CLANG || DOCTEST_GCC >= DOCTEST_COMPILER(8, 4, 0)
|
||||
// only known to work on Clang and GCC >=8.4
|
||||
CHECK_THROWS_WITH_AS(nlohmann::detail::std_fs::path(json(1)), "[json.exception.type_error.302] type must be string, but is number", json::type_error);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user