-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Fix compilation error with Clang, C++17, libc++, ordered_json and NLOHMANN_JSON_SERIALIZE_ENUM #2624
Conversation
@ alexezeder Can you please update to the latest develop branch? I overworked the CI and added quite some checks. |
@nlohmann, finally, CI has done its job |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change request, then it should be good to merge.
I don't know what should I do with an error in Windows/mingw:
|
Maybe https://digitalkarabela.com/mingw-w64-how-to-fix-file-too-big-too-many-sections/ can help. I will try to add that flag to the CI. |
Can you please change line 24 of file from
to
? |
Closes #2491.
Caused by the strange behavior (or maybe even a bug) of Clang described in the linked issue #2491 and also on LLVM bug tracker.
There are 2 commits - the first one is to add testing usage of
ordered_json
with enum (just like in the issue), the second resolves the problem for Clang with libc++ and C++17+. Since there is no CI workflow for that, I made a temporary workflow with Clang, C++17 and libc++ in my fork just to demonstrate the build results of these commits:P.S. I tried to reuse the existing Clang C++20 workflow for the temporary workflow with libc++, since there is no difference in Clang's behavior between C++17 and C++20 standards in this case, but libc++ of the used LLVM version does not provide
<span>
header, just for information.Filled checklist here
Pull request checklist
Read the Contribution Guidelines for detailed information.
include/nlohmann
directory, runmake amalgamate
to create the single-header filesingle_include/nlohmann/json.hpp
. The whole process is described here.Please don't
#ifdef
s or other means.