nlohmann / json

JSON for Modern C++
https://json.nlohmann.me
MIT License
42.97k stars 6.72k forks source link

tests/unit-iterators2: use std::ranges::equals for range comparisons #3950

Closed ArsenArsen closed 1 year ago

ArsenArsen commented 1 year ago

This fixes a build error on GCC 13:

/home/arsen/nlohmann_json/tests/src/unit-iterators2.cpp: In function ‘void _DOCTEST_ANON_FUNC_2()’: /home/arsen/nlohmann_json/tests/src/unit-iterators2.cpp:946:32: error: no match for ‘operator==’ (operand types are ‘doctest::detail::Expression_lhs<std::ranges::reverse_view<std::ranges::ref_view<nlohmann::json_abi_v3_11_2::basic_json<> > >&>’ and ‘nlohmann::json_abi_v3_11_2::json’ {aka ‘nlohmann::json_abi_v3_11_2::basic_json<>’}) 946 CHECK(reversed == j_expected); ^~ ~~
nlohmann::json_abi_v3_11_2::json {aka nlohmann::json_abi_v3_11_2::basic_json<>}

Bug: https://bugs.gentoo.org/895692 Closes: #3927

This PR also depends on trofis PR: #3895

Tested on x86_64-pc-linux-gnu in the default CMake configuration.

Pull request checklist

Read the Contribution Guidelines for detailed information.

Please don't

coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling a49829bd984c0282be18fcec070df0c31bf77dd5 on ArsenArsen:gcc13 into b2306145e1789368e6f261680e8dc007e91cc986 on nlohmann:develop.

nlohmann commented 1 year ago

Thanks!