diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2015-01-07 20:31:06 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2015-01-07 20:31:06 +0000 |
| commit | 66369c03a387f6c27cc92ba6184433daa4989dd2 (patch) | |
| tree | e1fae2848f1dd7890b27cf1cc1a76048adff40c2 /libcxx/test/std/utilities/function.objects/logical.operations | |
| parent | 627df427eb718d42669265d58a80607272ac9ccf (diff) | |
| download | bcm5719-llvm-66369c03a387f6c27cc92ba6184433daa4989dd2.tar.gz bcm5719-llvm-66369c03a387f6c27cc92ba6184433daa4989dd2.zip | |
In C++03, a bunch of the arithmetic/logical/comparison functors (such as add/equal_to/logical_or) were defined as deriving from binary_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.
llvm-svn: 225375
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/logical.operations')
| -rw-r--r-- | libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp | 4 | ||||
| -rw-r--r-- | libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp b/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp index c7b03cce095..72f9dc20144 100644 --- a/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/logical.operations/logical_and.pass.cpp @@ -19,7 +19,9 @@ int main() { typedef std::logical_and<int> F; const F f = F(); - static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), ""); + static_assert((std::is_same<int, F::first_argument_type>::value), "" ); + static_assert((std::is_same<int, F::second_argument_type>::value), "" ); + static_assert((std::is_same<bool, F::result_type>::value), "" ); assert(f(36, 36)); assert(!f(36, 0)); assert(!f(0, 36)); diff --git a/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp b/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp index 8b5420d8e04..7280504403f 100644 --- a/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/logical.operations/logical_or.pass.cpp @@ -19,7 +19,9 @@ int main() { typedef std::logical_or<int> F; const F f = F(); - static_assert((std::is_base_of<std::binary_function<int, int, bool>, F>::value), ""); + static_assert((std::is_same<int, F::first_argument_type>::value), "" ); + static_assert((std::is_same<int, F::second_argument_type>::value), "" ); + static_assert((std::is_same<bool, F::result_type>::value), "" ); assert(f(36, 36)); assert(f(36, 0)); assert(f(0, 36)); |

