STL_MSFT created this revision. STL_MSFT added reviewers: EricWF, mclow.lists. STL_MSFT added a subscriber: cfe-commits.
MSVC has finally fixed the compiler bug that was warning about unreferenced parameters when invoking destructors, so we can remove the void casts that were working around the bug. Yay! https://reviews.llvm.org/D25141 Files: test/support/test_allocator.h Index: test/support/test_allocator.h =================================================================== --- test/support/test_allocator.h +++ test/support/test_allocator.h @@ -88,10 +88,7 @@ {::new(static_cast<void*>(p)) T(std::forward<U>(val));} #endif void destroy(pointer p) - { - p->~T(); - ((void)p); // Prevent MSVC's spurious unused warning - } + {p->~T();} friend bool operator==(const test_allocator& x, const test_allocator& y) {return x.data_ == y.data_;} friend bool operator!=(const test_allocator& x, const test_allocator& y) @@ -291,10 +288,7 @@ template<typename U, typename... Args> void destroy(U* p) - { - p->~U(); - ((void)p); // Prevent MSVC's spurious unused warning - } + { p->~U(); } }; template<typename T, typename U>
Index: test/support/test_allocator.h =================================================================== --- test/support/test_allocator.h +++ test/support/test_allocator.h @@ -88,10 +88,7 @@ {::new(static_cast<void*>(p)) T(std::forward<U>(val));} #endif void destroy(pointer p) - { - p->~T(); - ((void)p); // Prevent MSVC's spurious unused warning - } + {p->~T();} friend bool operator==(const test_allocator& x, const test_allocator& y) {return x.data_ == y.data_;} friend bool operator!=(const test_allocator& x, const test_allocator& y) @@ -291,10 +288,7 @@ template<typename U, typename... Args> void destroy(U* p) - { - p->~U(); - ((void)p); // Prevent MSVC's spurious unused warning - } + { p->~U(); } }; template<typename T, typename U>
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits