🚨 fix C4100 warnings
This commit is contained in:
parent
288cdf9af7
commit
4b0e04eb68
@ -100,9 +100,6 @@ struct my_allocator : std::allocator<T>
|
|||||||
std::allocator<T>::deallocate(p, n);
|
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)
|
void destroy(T* p)
|
||||||
{
|
{
|
||||||
if (next_destroy_fails)
|
if (next_destroy_fails)
|
||||||
@ -111,9 +108,9 @@ struct my_allocator : std::allocator<T>
|
|||||||
throw std::bad_alloc();
|
throw std::bad_alloc();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static_cast<void>(p); // fix MSVC's C4100 warning
|
||||||
p->~T();
|
p->~T();
|
||||||
}
|
}
|
||||||
DOCTEST_MSVC_SUPPRESS_WARNING_POP
|
|
||||||
|
|
||||||
template <class U>
|
template <class U>
|
||||||
struct rebind
|
struct rebind
|
||||||
|
@ -809,10 +809,6 @@ TEST_CASE("an incomplete type does not trigger a compiler error in non-evaluated
|
|||||||
static_assert(!is_constructible_patched<json, incomplete>::value, "");
|
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
|
namespace
|
||||||
{
|
{
|
||||||
class Evil
|
class Evil
|
||||||
@ -820,13 +816,14 @@ class Evil
|
|||||||
public:
|
public:
|
||||||
Evil() = default;
|
Evil() = default;
|
||||||
template <typename T>
|
template <typename T>
|
||||||
Evil(T t) : m_i(sizeof(t)) {}
|
Evil(T t) : m_i(sizeof(t))
|
||||||
|
{
|
||||||
|
static_cast<void>(t); // fix MSVC's C4100 warning
|
||||||
|
}
|
||||||
|
|
||||||
int m_i = 0;
|
int m_i = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
DOCTEST_MSVC_SUPPRESS_WARNING_POP
|
|
||||||
|
|
||||||
void from_json(const json& /*unused*/, Evil& /*unused*/) {}
|
void from_json(const json& /*unused*/, Evil& /*unused*/) {}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user