Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite does not compile with C++20 and Clang 17 #3979

Closed
1 of 2 tasks
nlohmann opened this issue Mar 13, 2023 · 2 comments
Closed
1 of 2 tasks

Test suite does not compile with C++20 and Clang 17 #3979

nlohmann opened this issue Mar 13, 2023 · 2 comments
Labels
kind: bug solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@nlohmann
Copy link
Owner

nlohmann commented Mar 13, 2023

Description

With Clang 16, the test suite could be compiled with C++20, see https://github.com/nlohmann/json/actions/runs/4364410245/jobs/7631709068

When switching to Clang 17, there is an error: https://github.com/nlohmann/json/actions/runs/4409390311/jobs/7725631191#step:7:68

Reproduction steps

Compile the test suite with Clang 17 and C++20 standard enabled.

Expected vs. actual results

Expected: Test suite compiles.

Actual: Error message:

json/tests/src/unit-constructor1.cpp:282:34: error: invalid operands to binary expression ('Expression_lhs<const basic_string<char, char_traits<char>, allocator<char>> &>' and 'const value_type' (aka 'const nlohmann::basic_json<>'))
            CHECK(std::get<2>(t) == j[2]);
            ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

Minimal code example

No response

Error messages

json/tests/src/unit-constructor1.cpp:282:34: error: invalid operands to binary expression ('Expression_lhs<const basic_string<char, char_traits<char>, allocator<char>> &>' and 'const value_type' (aka 'const nlohmann::basic_json<>'))
            CHECK(std::get<2>(t) == j[2]);
            ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~

Compiler and operating system

Clang 17, Ubuntu

Library version

develop

Validation

@nlohmann
Copy link
Owner Author

See #3978 where I tried to fix the CI by setting some compile flags.

@nlohmann
Copy link
Owner Author

The CI now contains multiple jobs to compile with C++20 - both with Clang and GCC.

@nlohmann nlohmann added solution: proposed fix a fix for the issue has been proposed and waits for confirmation and removed state: help needed the issue needs help to proceed labels Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug solution: duplicate the issue is a duplicate; refer to the linked issue instead solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant