aboutsummaryrefslogtreecommitdiff
path: root/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/PR23141_invoke_not_constexpr.pass.cpp
blob: 5e347c4c571568180cac8c5d01d3faa01625bdb7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//===----------------------------------------------------------------------===//
//
//                     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.
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03

// <functional>

// template<CopyConstructible Fn, CopyConstructible... Types>
//   unspecified bind(Fn, Types...);
// template<Returnable R, CopyConstructible Fn, CopyConstructible... Types>
//   unspecified bind(Fn, Types...);

// https://llvm.org/bugs/show_bug.cgi?id=23141
#include <functional>
#include <type_traits>

struct Fun
{
  template<typename T, typename U>
  void operator()(T &&, U &&) const
  {
    static_assert(std::is_same<U, int &>::value, "");
  }
};

int main()
{
    std::bind(Fun{}, std::placeholders::_1, 42)("hello");
}