From 2d15f15f285fd0dee552ba7f91bb4daf244cbdf4 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 10 Jul 2015 23:29:18 +0000 Subject: [libcxx] LWG2420 bits for bind - Patch from K-Ballo Implemented LWG2420 bits for bind Review: http://reviews.llvm.org/D10997 llvm-svn: 241967 --- .../func.bind/func.bind.bind/invoke_void_0.pass.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libcxx/test/std/utilities/function.objects/bind') 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(f)); test(std::bind(&f)); + test(std::bind(A_void_0())); + test_const(std::bind(A_void_0())); + + test(std::bind(g)); + test(std::bind(&g)); test(std::bind(A_int_0())); test_const(std::bind(A_int_0())); } -- cgit v1.2.3