File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
libcxx/test/std/utilities/function.objects/func.bind.partial Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 17
17
18
18
#include " types.h"
19
19
20
+ constexpr int pass (int n) { return n; }
21
+
20
22
void test () {
21
- { // Various failures
22
- auto p = std::bind_back (pass, 1 );
23
- static_assert (p () == 1 ); // expected-error {{static assertion expression is not an integral constant expression}}
23
+ { // Test calling constexpr function from non-constexpr `bind_back` unspecified-type
24
+ auto f1 = std::bind_back (pass, 1 );
25
+ static_assert (f1 () == 1 ); // expected-error {{static assertion expression is not an integral constant expression}}
26
+ }
24
27
28
+ { // Various failures
25
29
auto d = std::bind_back (do_nothing, 2 ); // expected-error {{no matching function for call to 'bind_back'}}
26
30
}
27
31
Original file line number Diff line number Diff line change @@ -35,8 +35,6 @@ struct CopyMoveInfo {
35
35
constexpr CopyMoveInfo (CopyMoveInfo&&) : copy_kind(move) {}
36
36
};
37
37
38
- constexpr int pass (int n) { return n; }
39
-
40
38
template <class T >
41
39
T do_nothing (T t) {
42
40
return t;
You can’t perform that action at this time.
0 commit comments