-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Visual Studio 2017 15.8.5 "conditional expression is constant" warning on Line 1851 in json.hpp #1268
Comments
This library only requires a C++11 compiler, so |
We could add a template @cugone Would you like to open a PR? |
Maybe a duplicate of #1204. |
And, of course, a PR would be greatly appreciated! |
@nlohmann Attempted PR but Visual Studio's support of makefiles is lacking. Using nmake via VS developer console to try to run the makefile as per CONTRIBUTING.md complains: "makefile(33) : fatal error U1000: syntax error : ')' missing in macro invocation". :( Anyway, after looking at the most recent push to json.hpp prior to Aug 20, yes, it is an exact duplicate of #1204. Visual Studio has been fully C++14 compliant since or before VS2017 RTM (VS 15.0) was released. If your holdout to moving to at least support C++14 was visual studio, I think it would be a good time to at least support that for now. See: https://blogs.msdn.microsoft.com/vcblog/2018/05/07/announcing-msvc-conforms-to-the-c-standard/ Sadly, yes, |
Fixed by merging #1272. |
There is a warning "conditional expression is constant" issued for VIsual Studio 2017 version 15.8.5 on Line 1851 of the json.hpp single-include header. I have Treat Warnings As Errors turned on as well as the Warning Level set to 4 so this prevents successful compilation. I do not use Clang nor GCC so I do not know if a similar issue shows up and this is just an edge case and can be safely pragma'd out.
(Immediate surrounding code provided for context)
it can be fixed by changing the
if-statement
to aconstexpr-if
:if constexpr (sizeof(typename WideStringType::value_type) == 2) { //...
The text was updated successfully, but these errors were encountered: