-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Unit tests conversions & items fail to build (Clang <4.0/C++14 only) #3384
Comments
Fixing this is going to be a requirement for #3385 I just realized. |
Alright, the test suit never compiled the code with Clang <4.0 in C++14 mode and no one seems to have complained about it. After spending about an hour on this with no luck I'm leaning towards blanket disabling C++14 for Clang <4.0 and am going to implement that change in #3380. Any objections? @nlohmann |
The library targets C++11, so we used to not care too much about C++14/C++17/C++20. We only added tests for C++ beyond 2011 lately - in particular for added C++17 features. These tests only take a "recent" compiler rather than testing each and every compiler version here. To summarize: I do not care too much whether older compilers are C++14 compliant. |
Clang 3.9 supports C++14 decently. This bug drops support for Clang < 4.0 from projects that uses this library and are written in C++14. Please, consider fix this. Here the test on godbolt with clang 3.9.1: https://godbolt.org/z/WPEnxGEsG |
I've checked that v3.10.3 with clang 3.9.1/C++14 is fine. The bug has been introduced in v3.10.4. |
- The json reader (v3.10.5) added for parmodlica does not compile with clang < 4.0. Downgrade it to v3.10.3 which compiles fine and provides everything we needed anyway. Upstream issue: nlohmann/json#3384
- The json reader (v3.10.5) added for parmodlica does not compile with clang < 4.0. Downgrade it to v3.10.3 which compiles fine and provides everything we needed anyway. Upstream issue: nlohmann/json#3384
So the good news is that this might be fixable with a single line. I haven't run it through CI yet, only tested it locally with clang 3.9.1 and GCC 12. |
Constrain from_json() overload for ConstructibleStringType to not accept json_ref and require assignability. Re-enable C++14 tests on Clang <4.0. Fixes nlohmann#3171, nlohmann#3312, nlohmann#3384. Maybe fixes nlohmann#3267.
Constrain from_json() overload for ConstructibleStringType to not accept json_ref and require it to be assignable from basic_json::string_t. Re-enable C++14 tests on Clang <4.0. Fixes nlohmann#3171. Fixes nlohmann#3267. Fixes nlohmann#3312. Fixes nlohmann#3384.
Constrain from_json() overload for StringType to not accept json_ref and require it to be assignable, instead of constructible, from basic_json::string_t. Re-enable C++14 tests on Clang <4.0. Fixes nlohmann#3171. Fixes nlohmann#3267. Fixes nlohmann#3312. Fixes nlohmann#3384.
Unit tests
test-conversions_cpp14
andtest-items_cpp14
fail to build with Clang <4.0. C++11 builds are fine and starting with version 4.0 the C++14 builds succeed as well.I've disabled these tests in #3380.
Edit: In fact, simply compiling an empty
main()
includingjson.hpp
fails, meaning this is unrelated to the specific tests but C++14 in general.The text was updated successfully, but these errors were encountered: