1 //===----------------------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03
10
11 // <functional>
12
13 // template<CopyConstructible Fn, CopyConstructible... Types>
14 // unspecified bind(Fn, Types...);
15 // template<Returnable R, CopyConstructible Fn, CopyConstructible... Types>
16 // unspecified bind(Fn, Types...);
17
18 // https://llvm.org/PR23141
19 #include <functional>
20 #include <type_traits>
21
22 #include "test_macros.h"
23
24 struct Fun
25 {
26 template<typename T, typename U>
operator ()Fun27 void operator()(T &&, U &&) const
28 {
29 static_assert(std::is_same<U, int &>::value, "");
30 }
31 };
32
main(int,char **)33 int main(int, char**)
34 {
35 std::bind(Fun{}, std::placeholders::_1, 42)("hello");
36
37 return 0;
38 }
39