[libcxx] r277572 - Silence another occurrence of MSVC's suprious unused warning. Patch from STL at microsoft.com

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 2 22:46:36 PDT 2016


Author: ericwf
Date: Wed Aug  3 00:46:36 2016
New Revision: 277572

URL: http://llvm.org/viewvc/llvm-project?rev=277572&view=rev
Log:
Silence another occurrence of MSVC's suprious unused 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=277572&r1=277571&r2=277572&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_allocator.h (original)
+++ libcxx/trunk/test/support/test_allocator.h Wed Aug  3 00:46:36 2016
@@ -291,7 +291,10 @@ public:
 
     template<typename U, typename... Args>
     void destroy(U* p)
-    { p->~U(); }
+    {
+        p->~U();
+        ((void)p); // Prevent MSVC's spurious unused warning
+    }
 };
 
 template<typename T, typename U>




More information about the cfe-commits mailing list