Void cast runtime-unused variables. Patch from STL@microsoft.com
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@268284 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -36,7 +36,10 @@ void test_pointer()
|
||||
{
|
||||
typename std::allocator_traits<Alloc>::pointer vp;
|
||||
typename std::allocator_traits<Alloc>::const_pointer cvp;
|
||||
|
||||
|
||||
((void)vp); // Prevent unused warning
|
||||
((void)cvp); // Prevent unused warning
|
||||
|
||||
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
|
||||
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
|
||||
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
|
||||
@@ -70,7 +73,10 @@ void test_void_pointer()
|
||||
{
|
||||
typename std::allocator_traits<Alloc>::void_pointer vp;
|
||||
typename std::allocator_traits<Alloc>::const_void_pointer cvp;
|
||||
|
||||
|
||||
((void)vp); // Prevent unused warning
|
||||
((void)cvp); // Prevent unused warning
|
||||
|
||||
static_assert(std::is_same<bool, decltype( vp == vp)>::value, "");
|
||||
static_assert(std::is_same<bool, decltype( vp != vp)>::value, "");
|
||||
static_assert(std::is_same<bool, decltype( vp > vp)>::value, "");
|
||||
|
||||
Reference in New Issue
Block a user