[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / func.bind_front / bind_front.verify.cpp
blob5100259bd5b299baf7e5c7cacbfb4be0264fa8b2
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14, c++17
11 // functional
13 // template <class F, class... Args>
14 // constexpr unspecified bind_front(F&&, Args&&...);
16 #include <functional>
18 constexpr int pass(const int n) { return n; }
20 int simple(int n) { return n; }
22 template<class T>
23 T do_nothing(T t) { return t; }
25 struct NotMoveConst
27 NotMoveConst(NotMoveConst &&) = delete;
28 NotMoveConst(NotMoveConst const&) = delete;
30 NotMoveConst(int) { }
33 void testNotMoveConst(NotMoveConst) { }
35 void f() {
36 int n = 1;
37 const int c = 1;
39 auto p = std::bind_front(pass, c);
40 static_assert(p() == 1); // expected-error {{static assertion expression is not an integral constant expression}}
42 auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}}
44 auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // expected-error {{no matching function for call to 'bind_front'}}