184a50f59Szoecarver //===----------------------------------------------------------------------===// 284a50f59Szoecarver // 384a50f59Szoecarver // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 484a50f59Szoecarver // See https://llvm.org/LICENSE.txt for license information. 584a50f59Szoecarver // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 684a50f59Szoecarver // 784a50f59Szoecarver //===----------------------------------------------------------------------===// 884a50f59Szoecarver 9e35677c0SLouis Dionne // UNSUPPORTED: c++03, c++11, c++14, c++17 1084a50f59Szoecarver 1184a50f59Szoecarver // functional 1284a50f59Szoecarver 13f599e7a7SLouis Dionne // template <class F, class... Args> 14f599e7a7SLouis Dionne // constexpr unspecified bind_front(F&&, Args&&...); 1584a50f59Szoecarver 1684a50f59Szoecarver #include <functional> 1784a50f59Szoecarver pass(const int n)1884a50f59Szoecarverconstexpr int pass(const int n) { return n; } 1984a50f59Szoecarver simple(int n)2084a50f59Szoecarverint simple(int n) { return n; } 2184a50f59Szoecarver 2284a50f59Szoecarver template<class T> do_nothing(T t)2384a50f59SzoecarverT do_nothing(T t) { return t; } 2484a50f59Szoecarver 2584a50f59Szoecarver struct NotMoveConst 2684a50f59Szoecarver { 2784a50f59Szoecarver NotMoveConst(NotMoveConst &&) = delete; 2884a50f59Szoecarver NotMoveConst(NotMoveConst const&) = delete; 2984a50f59Szoecarver NotMoveConstNotMoveConst3084a50f59Szoecarver NotMoveConst(int) { } 3184a50f59Szoecarver }; 3284a50f59Szoecarver testNotMoveConst(NotMoveConst)3384a50f59Szoecarvervoid testNotMoveConst(NotMoveConst) { } 3484a50f59Szoecarver f()3572f0edf3SLouis Dionnevoid f() { 3684a50f59Szoecarver int n = 1; 3784a50f59Szoecarver const int c = 1; 3884a50f59Szoecarver 3984a50f59Szoecarver auto p = std::bind_front(pass, c); 40*9bb9ec38SLouis Dionne static_assert(p() == 1); // expected-error {{static assertion expression is not an integral constant expression}} 4184a50f59Szoecarver 4284a50f59Szoecarver auto d = std::bind_front(do_nothing, n); // expected-error {{no matching function for call to 'bind_front'}} 4384a50f59Szoecarver 4484a50f59Szoecarver auto t = std::bind_front(testNotMoveConst, NotMoveConst(0)); // expected-error {{no matching function for call to 'bind_front'}} 4584a50f59Szoecarver } 46