[libcxx] [test] Add return values after assert(false) in some experimental tests

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
This commit is contained in:
Martin Storsjö 2021-03-23 18:42:32 +02:00
parent c68a645acb
commit b6c4b280a0
2 changed files with 12 additions and 12 deletions

View File

@ -25,14 +25,14 @@ namespace ex = std::experimental::pmr;
struct assert_on_compare : public ex::memory_resource
{
protected:
virtual void * do_allocate(size_t, size_t)
void * do_allocate(size_t, size_t) override
{ assert(false); return nullptr; }
void do_deallocate(void *, size_t, size_t) override
{ assert(false); }
virtual void do_deallocate(void *, size_t, size_t)
{ 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()

View File

@ -25,14 +25,14 @@ namespace ex = std::experimental::pmr;
struct assert_on_compare : public ex::memory_resource
{
protected:
virtual void * do_allocate(size_t, size_t)
void * do_allocate(size_t, size_t) override
{ assert(false); return nullptr; }
void do_deallocate(void *, size_t, size_t) override
{ assert(false); }
virtual void do_deallocate(void *, size_t, size_t)
{ 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()