From 5c51ac7af8144ebdc943e7103e18d2731f317fff Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 6 Mar 2022 16:39:45 +0100 Subject: [PATCH] Disable broken comparison tests in C++20 mode --- test/src/unit-comparison.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/src/unit-comparison.cpp b/test/src/unit-comparison.cpp index 4feccef44..f4853f585 100644 --- a/test/src/unit-comparison.cpp +++ b/test/src/unit-comparison.cpp @@ -32,6 +32,10 @@ SOFTWARE. #include using nlohmann::json; +#if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L) + #define JSON_HAS_CPP_20 +#endif + namespace { // helper function to check std::less @@ -205,6 +209,14 @@ TEST_CASE("lexicographical comparison operators") { for (size_t j = 0; j < j_values.size(); ++j) { + // Skip comparing indicies 12 and 13, and 13 and 12 in C++20 pending fix + // See issue #3207 +#ifdef JSON_HAS_CPP_20 + if ((i == 12 && j == 13) || (i == 13 && j == 12)) + { + continue; + } +#endif CAPTURE(i) CAPTURE(j) CAPTURE(j_values[i])