-
-
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
Treat MSVC warnings as errors #2930
Conversation
test/src/unit-allocator.cpp
Outdated
@@ -100,6 +100,9 @@ struct my_allocator : std::allocator<T> | |||
std::allocator<T>::deallocate(p, n); | |||
} | |||
|
|||
// the code below warns about p in MSVC 2015 - this could be a bug |
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.
"C4100 can also be issued when code calls a destructor on a otherwise unreferenced parameter of primitive type. This is a limitation of the Microsoft C++ compiler."
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4100?view=msvc-160
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.
Thanks, I fixed it.
test/src/unit-udt.cpp
Outdated
@@ -809,6 +809,10 @@ TEST_CASE("an incomplete type does not trigger a compiler error in non-evaluated | |||
static_assert(!is_constructible_patched<json, incomplete>::value, ""); | |||
} | |||
|
|||
// the code below warns about t in MSVC 2015 - this could be a bug | |||
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH |
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.
Same class of error as the other one, sizeof(t)
is a compile-time constant based only on T
, not on the value of t
.
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.
Thanks, I also fixed it.
This PR is a follow up to #2924 and treats all MSVC warnings as errors.