diff options
Diffstat (limited to 'libcxx/test/std/utilities/function.objects')
-rw-r--r-- | libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp index 03447db33de..b7874b77cf0 100644 --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/invoke_void_0.pass.cpp @@ -39,21 +39,34 @@ test_const(const F& f) void f() {++count;} -struct A_int_0 +int g() {++count; return 0;} + +struct A_void_0 { void operator()() {++count;} void operator()() const {count += 2;} }; +struct A_int_0 +{ + int operator()() {++count; return 4;} + int operator()() const {count += 2; return 5;} +}; + int main() { test(std::bind(f)); test(std::bind(&f)); - test(std::bind(A_int_0())); - test_const(std::bind(A_int_0())); + test(std::bind(A_void_0())); + test_const(std::bind(A_void_0())); test(std::bind<void>(f)); test(std::bind<void>(&f)); + test(std::bind<void>(A_void_0())); + test_const(std::bind<void>(A_void_0())); + + test(std::bind<void>(g)); + test(std::bind<void>(&g)); test(std::bind<void>(A_int_0())); test_const(std::bind<void>(A_int_0())); } |