When building in MSVC mode (in release mode), the assert(false) don't
make the end of the function unreachable, so add return statements to
silence compiler warnings (treated as errors).
Also change 'virtual' into 'override', which was requested in review,
as these files require C++11.
Differential Revision: https://reviews.llvm.org/D99214
struct assert_on_compare : public ex::memory_resource
{
protected:
- virtual void * do_allocate(size_t, size_t)
- { assert(false); }
+ void * do_allocate(size_t, size_t) override
+ { assert(false); return nullptr; }
- virtual void do_deallocate(void *, size_t, size_t)
+ void do_deallocate(void *, size_t, size_t) override
{ assert(false); }
- virtual bool do_is_equal(ex::memory_resource const &) const noexcept
- { assert(false); }
+ bool do_is_equal(ex::memory_resource const &) const noexcept override
+ { assert(false); return false; }
};
void test_return()
struct assert_on_compare : public ex::memory_resource
{
protected:
- virtual void * do_allocate(size_t, size_t)
- { assert(false); }
+ void * do_allocate(size_t, size_t) override
+ { assert(false); return nullptr; }
- virtual void do_deallocate(void *, size_t, size_t)
+ void do_deallocate(void *, size_t, size_t) override
{ assert(false); }
- virtual bool do_is_equal(ex::memory_resource const &) const noexcept
- { assert(false); }
+ bool do_is_equal(ex::memory_resource const &) const noexcept override
+ { assert(false); return false; }
};
void test_return()