⚗️ add -WX flag to MSVC builds

pull/2930/head
Niels Lohmann 2021-08-13 14:07:17 +02:00
parent fecb01858b
commit 288cdf9af7
No known key found for this signature in database
GPG Key ID: 7F3CEA63AE251B69
2 changed files with 10 additions and 0 deletions

View File

@ -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
DOCTEST_MSVC_SUPPRESS_WARNING_PUSH
DOCTEST_MSVC_SUPPRESS_WARNING(4100)
void destroy(T* p)
{
if (next_destroy_fails)
@ -110,6 +113,7 @@ struct my_allocator : std::allocator<T>
p->~T();
}
DOCTEST_MSVC_SUPPRESS_WARNING_POP
template <class U>
struct rebind

View File

@ -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
DOCTEST_MSVC_SUPPRESS_WARNING(4100)
namespace
{
class Evil
@ -821,6 +825,8 @@ class Evil
int m_i = 0;
};
DOCTEST_MSVC_SUPPRESS_WARNING_POP
void from_json(const json& /*unused*/, Evil& /*unused*/) {}
} // namespace