15a83710eSEric Fiselier //===----------------------------------------------------------------------===//
25a83710eSEric Fiselier //
357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65a83710eSEric Fiselier //
75a83710eSEric Fiselier //===----------------------------------------------------------------------===//
85a83710eSEric Fiselier
95a83710eSEric Fiselier // <functional>
105a83710eSEric Fiselier
115a83710eSEric Fiselier // binary_negate
125a83710eSEric Fiselier
13*dc066888SArthur O'Dwyer // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_BINDER_TYPEDEFS
14d42d9e10SArthur O'Dwyer // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX20_REMOVED_NEGATORS
15f8b65292SLouis Dionne // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
16a470a13aSLouis Dionne
175a83710eSEric Fiselier #include <functional>
185a83710eSEric Fiselier #include <type_traits>
195a83710eSEric Fiselier #include <cassert>
205a83710eSEric Fiselier
217fc6a556SMarshall Clow #include "test_macros.h"
227fc6a556SMarshall Clow
main(int,char **)232df59c50SJF Bastien int main(int, char**)
245a83710eSEric Fiselier {
255a83710eSEric Fiselier typedef std::binary_negate<std::logical_and<int> > F;
265a83710eSEric Fiselier const F f = F(std::logical_and<int>());
2766369c03SMarshall Clow static_assert((std::is_same<int, F::first_argument_type>::value), "" );
2866369c03SMarshall Clow static_assert((std::is_same<int, F::second_argument_type>::value), "" );
2966369c03SMarshall Clow static_assert((std::is_same<bool, F::result_type>::value), "" );
305a83710eSEric Fiselier assert(!f(36, 36));
315a83710eSEric Fiselier assert( f(36, 0));
325a83710eSEric Fiselier assert( f(0, 36));
335a83710eSEric Fiselier assert( f(0, 0));
342df59c50SJF Bastien
352df59c50SJF Bastien return 0;
365a83710eSEric Fiselier }
37