Disable broken comparison tests in C++20 mode

This commit is contained in:
Florian Albrechtskirchinger 2022-03-06 16:39:45 +01:00
parent c21ed8aabe
commit 5c51ac7af8

View File

@ -32,6 +32,10 @@ SOFTWARE.
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
using nlohmann::json; using nlohmann::json;
#if (defined(__cplusplus) && __cplusplus >= 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L)
#define JSON_HAS_CPP_20
#endif
namespace namespace
{ {
// helper function to check std::less<json::value_t> // helper function to check std::less<json::value_t>
@ -205,6 +209,14 @@ TEST_CASE("lexicographical comparison operators")
{ {
for (size_t j = 0; j < j_values.size(); ++j) 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(i)
CAPTURE(j) CAPTURE(j)
CAPTURE(j_values[i]) CAPTURE(j_values[i])