-
-
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
Use JSON_HAS_CPP_17 only after it has been defined #1872
Conversation
I seem to have messed up the amalgamation. I will try to figure out how the files are combined so that the JSON_HAS_CPP_17 is used only after language standard detection in single_include json.hpp. |
982b6fe
to
c8c1f19
Compare
Okay now the amalgamation issue is fixed. I am not sure if this a proper place for including, but I moved the #include to macro_scope.hpp just after the language standard detection. |
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.
Looks good to me.
Good catch!
Let's wait for the CI to become green. |
c8c1f19
to
1b846c9
Compare
Sorry for re-triggering the CI. Fixed committer email. |
There still seems to be an issue in the latest AppVeyor builds. |
Yes it is the conversion issue that I mentioned in #1749.
I can try looking into this myself today, but I am not sure if I can find the correct place. What I think is missing is implicit conversion from The compiler errors are: I was kind of hoping that you would immediately know what would be required. |
I see. I did not have a look at the error message, but just hoped that the PR would fix them ;-) I have no idea what the issue is. I am not expert with MSVC, and since GCC and Clang compile the code, it seems OK. However, I think merging your changes into the feature branch is a good idea anyway since it fixes the issue with the macro definition. |
Thanks for merging the PR. If you mean that Travis compiles the code on GCC and Clang you would be mistaken since looking at the build logs only 2 test cases (270 assertions) are being run for test-conversions.exe for all builds regardless of the compiler or options used. When JSON_HAS_CPP_17 is defined there should be 3 test cases (298 assertions). I think there is something wrong with the language standard detection for GCC and Clang so JSON_HAS_CPP_17 is always undefined therefore the problematic unit test code does not seem to be compiled on GCC or Clang at all. |
Fix for Visual Studio "error C2039: 'optional': is not a member of 'std'" #1749