1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
13 // Make sure that we can use CTAD with operations in <functional>
17 #include "test_macros.h"
19 int main(int, char**) {
22 ASSERT_SAME_TYPE(decltype(f
), std::plus
<>);
26 ASSERT_SAME_TYPE(decltype(f
), std::minus
<>);
30 ASSERT_SAME_TYPE(decltype(f
), std::multiplies
<>);
34 ASSERT_SAME_TYPE(decltype(f
), std::divides
<>);
38 ASSERT_SAME_TYPE(decltype(f
), std::modulus
<>);
42 ASSERT_SAME_TYPE(decltype(f
), std::negate
<>);
46 ASSERT_SAME_TYPE(decltype(f
), std::bit_and
<>);
50 ASSERT_SAME_TYPE(decltype(f
), std::bit_not
<>);
54 ASSERT_SAME_TYPE(decltype(f
), std::bit_or
<>);
58 ASSERT_SAME_TYPE(decltype(f
), std::bit_xor
<>);
62 ASSERT_SAME_TYPE(decltype(f
), std::equal_to
<>);
66 ASSERT_SAME_TYPE(decltype(f
), std::not_equal_to
<>);
70 ASSERT_SAME_TYPE(decltype(f
), std::less
<>);
74 ASSERT_SAME_TYPE(decltype(f
), std::less_equal
<>);
78 ASSERT_SAME_TYPE(decltype(f
), std::greater_equal
<>);
82 ASSERT_SAME_TYPE(decltype(f
), std::greater
<>);
86 ASSERT_SAME_TYPE(decltype(f
), std::logical_and
<>);
90 ASSERT_SAME_TYPE(decltype(f
), std::logical_not
<>);
94 ASSERT_SAME_TYPE(decltype(f
), std::logical_or
<>);