From 87d03942c428bfabf09738cde2885549a60bc03d Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Wed, 7 Jan 2015 21:51:30 +0000 Subject: [PATCH] In C++03, a bunch of the arithmetic/logical/comparison functors (such as negate/bit_not.pass/logical_not) were defined as deriving from unary_funtion. That restriction was removed in C++11, but the tests still check for this. Change the test to look for the embedded types first_argument/second_argument/result_type. No change to the library, just more standards-compliant tests. Thanks to STL @ Microsoft for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@225402 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../function.objects/arithmetic.operations/negate.pass.cpp | 3 ++- .../function.objects/bitwise.operations/bit_not.pass.cpp | 3 ++- .../function.objects/logical.operations/logical_not.pass.cpp | 3 ++- .../utilities/function.objects/negators/unary_negate.pass.cpp | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp b/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp index 3ffb7051b..0adac6591 100644 --- a/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp +++ b/test/std/utilities/function.objects/arithmetic.operations/negate.pass.cpp @@ -19,7 +19,8 @@ int main() { typedef std::negate F; const F f = F(); - static_assert((std::is_base_of, F>::value), ""); + static_assert((std::is_same::value), "" ); + static_assert((std::is_same::value), "" ); assert(f(36) == -36); #if _LIBCPP_STD_VER > 11 typedef std::negate<> F2; diff --git a/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp b/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp index 82efcbc29..48800a366 100644 --- a/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp +++ b/test/std/utilities/function.objects/bitwise.operations/bit_not.pass.cpp @@ -20,7 +20,8 @@ int main() #if _LIBCPP_STD_VER > 11 typedef std::bit_not F; const F f = F(); - static_assert((std::is_base_of, F>::value), ""); + static_assert((std::is_same::value), "" ); + static_assert((std::is_same::value), "" ); assert((f(0xEA95) & 0xFFFF ) == 0x156A); assert((f(0x58D3) & 0xFFFF ) == 0xA72C); assert((f(0) & 0xFFFF ) == 0xFFFF); diff --git a/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp b/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp index 12b3543c5..8484625a7 100644 --- a/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp +++ b/test/std/utilities/function.objects/logical.operations/logical_not.pass.cpp @@ -19,7 +19,8 @@ int main() { typedef std::logical_not F; const F f = F(); - static_assert((std::is_base_of, F>::value), ""); + static_assert((std::is_same::value), "" ); + static_assert((std::is_same::value), "" ); assert(!f(36)); assert(f(0)); #if _LIBCPP_STD_VER > 11 diff --git a/test/std/utilities/function.objects/negators/unary_negate.pass.cpp b/test/std/utilities/function.objects/negators/unary_negate.pass.cpp index 2aa4f0ab4..e2498a3b5 100644 --- a/test/std/utilities/function.objects/negators/unary_negate.pass.cpp +++ b/test/std/utilities/function.objects/negators/unary_negate.pass.cpp @@ -19,7 +19,8 @@ int main() { typedef std::unary_negate > F; const F f = F(std::logical_not()); - static_assert((std::is_base_of, F>::value), ""); + static_assert((std::is_same::value), "" ); + static_assert((std::is_same::value), "" ); assert(f(36)); assert(!f(0)); }