diff options
author | Eric Fiselier <eric@efcs.ca> | 2015-07-10 23:29:18 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2015-07-10 23:29:18 +0000 |
commit | 2d15f15f285fd0dee552ba7f91bb4daf244cbdf4 (patch) | |
tree | 3c86f9c36877b2faed12dc86cdd924a93744ab01 /libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind | |
parent | 12d528493eb7d75d4dba6a72853c1c0b61876325 (diff) | |
download | bcm5719-llvm-2d15f15f285fd0dee552ba7f91bb4daf244cbdf4.tar.gz bcm5719-llvm-2d15f15f285fd0dee552ba7f91bb4daf244cbdf4.zip |
[libcxx] LWG2420 bits for bind<void> - Patch from K-Ballo
Implemented LWG2420 bits for bind<void>
Review: http://reviews.llvm.org/D10997
llvm-svn: 241967
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind')
-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())); } |