From 7582e3938bb9fb3e4664efdfb2313df29f27b70b Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 16 May 2017 19:47:31 +0000 Subject: Vendor import of libc++ trunk r303197: https://llvm.org/svn/llvm-project/libcxx/trunk@303197 --- .../function.objects/refwrap/binary.pass.cpp | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp (limited to 'test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp') diff --git a/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp b/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp new file mode 100644 index 000000000000..579e81fe69e6 --- /dev/null +++ b/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// reference_wrapper + +// check for deriving from binary_function + +#include +#include + +class functor1 + : public std::unary_function +{ +}; + +class functor2 + : public std::binary_function +{ +}; + +class functor3 + : public std::unary_function, + public std::binary_function +{ +public: + typedef float result_type; +}; + +class functor4 + : public std::unary_function, + public std::binary_function +{ +public: +}; + +struct C +{ + typedef int argument_type; + typedef int result_type; +}; + +int main() +{ + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((!std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); + static_assert((std::is_base_of, + std::reference_wrapper >::value), ""); +} -- cgit v1.2.3