[libcxx] r273350 - Suppress stupid and incorrect MSVC warning. patch from STL at microsoft.com
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 21 18:02:08 PDT 2016
Author: ericwf
Date: Tue Jun 21 20:02:08 2016
New Revision: 273350
URL: http://llvm.org/viewvc/llvm-project?rev=273350&view=rev
Log:
Suppress stupid and incorrect MSVC warning. patch from STL at microsoft.com
Modified:
libcxx/trunk/test/support/test_allocator.h
Modified: libcxx/trunk/test/support/test_allocator.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_allocator.h?rev=273350&r1=273349&r2=273350&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_allocator.h (original)
+++ libcxx/trunk/test/support/test_allocator.h Tue Jun 21 20:02:08 2016
@@ -87,7 +87,11 @@ public:
template <class U> void construct(pointer p, U&& val)
{::new(static_cast<void*>(p)) T(std::forward<U>(val));}
#endif
- void destroy(pointer p) {p->~T();}
+ void destroy(pointer p)
+ {
+ p->~T();
+ ((void)p); // Prevent MSVC's spurious unused warning
+ }
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)
More information about the cfe-commits
mailing list