From bf25231d5d6ac58c13b0ca8d6d478497487c4999 Mon Sep 17 00:00:00 2001 From: Miro Knejp Date: Wed, 2 Nov 2016 13:35:48 +0100 Subject: [PATCH] Avoid -Wunreachable-code in do_allocate() do_allocate() triggered the warning "code will never be executed [-Wunreachable-code]" in Clang. Changed both do_allocate and do_deallocate to keep the existing similarity. --- src/global_resource.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/global_resource.cpp b/src/global_resource.cpp index 23ca978..15f4fe4 100644 --- a/src/global_resource.cpp +++ b/src/global_resource.cpp @@ -31,10 +31,10 @@ class new_delete_resource_imp {} virtual void* do_allocate(std::size_t bytes, std::size_t alignment) - { return new char[bytes]; (void)bytes; (void)alignment; } + { (void)bytes; (void)alignment; return new char[bytes]; } virtual void do_deallocate(void* p, std::size_t bytes, std::size_t alignment) - { delete[]((char*)p); (void)bytes; (void)alignment; } + { (void)bytes; (void)alignment; delete[]((char*)p); } virtual bool do_is_equal(const memory_resource& other) const BOOST_NOEXCEPT { return &other == this; }