summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-04-18 06:17:30 +0000
committerEric Fiselier <eric@efcs.ca>2016-04-18 06:17:30 +0000
commit2152fd7682e3725449fc6483141dc55fc80dad16 (patch)
treeffc09c3c81b33127dc7ea73eccf76d9b8272de4a /libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
parent76a7ca0f67379705773c4d1da89e546667ff25f2 (diff)
downloadbcm5719-llvm-2152fd7682e3725449fc6483141dc55fc80dad16.tar.gz
bcm5719-llvm-2152fd7682e3725449fc6483141dc55fc80dad16.zip
Implement LWG issue 2219 - support reference_wrapper in INVOKE
llvm-svn: 266590
Diffstat (limited to 'libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp')
-rw-r--r--libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp b/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
index 97b0b4d158a..3f02c7c4c81 100644
--- a/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
+++ b/libcxx/test/std/utilities/function.objects/func.invoke/invoke.pass.cpp
@@ -174,6 +174,32 @@ void bullet_one_two_tests() {
}
{
TestClass cl_obj(42);
+ std::reference_wrapper<TestClass> cl(cl_obj);
+ test_b12<int&(NonCopyable&&) &, int&>(cl);
+ test_b12<int const&(NonCopyable&&) const &, int const&>(cl);
+ test_b12<int volatile&(NonCopyable&&) volatile &, int volatile&>(cl);
+ test_b12<int const volatile&(NonCopyable&&) const volatile &, int const volatile&>(cl);
+
+ test_b12<int&(NonCopyable&&) &, int&>(std::move(cl));
+ test_b12<int const&(NonCopyable&&) const &, int const&>(std::move(cl));
+ test_b12<int volatile&(NonCopyable&&) volatile &, int volatile&>(std::move(cl));
+ test_b12<int const volatile&(NonCopyable&&) const volatile &, int const volatile&>(std::move(cl));
+ }
+ {
+ DerivedFromTestClass cl_obj(42);
+ std::reference_wrapper<DerivedFromTestClass> cl(cl_obj);
+ test_b12<int&(NonCopyable&&) &, int&>(cl);
+ test_b12<int const&(NonCopyable&&) const &, int const&>(cl);
+ test_b12<int volatile&(NonCopyable&&) volatile &, int volatile&>(cl);
+ test_b12<int const volatile&(NonCopyable&&) const volatile &, int const volatile&>(cl);
+
+ test_b12<int&(NonCopyable&&) &, int&>(std::move(cl));
+ test_b12<int const&(NonCopyable&&) const &, int const&>(std::move(cl));
+ test_b12<int volatile&(NonCopyable&&) volatile &, int volatile&>(std::move(cl));
+ test_b12<int const volatile&(NonCopyable&&) const volatile &, int const volatile&>(std::move(cl));
+ }
+ {
+ TestClass cl_obj(42);
TestClass *cl = &cl_obj;
test_b12<int&(NonCopyable&&) &, int&>(cl);
test_b12<int const&(NonCopyable&&) const &, int const&>(cl);
@@ -219,6 +245,22 @@ void bullet_three_four_tests() {
}
{
typedef TestClass Fn;
+ Fn cl(42);
+ test_b34<int&>(std::reference_wrapper<Fn>(cl));
+ test_b34<int const&>(std::reference_wrapper<Fn const>(cl));
+ test_b34<int volatile&>(std::reference_wrapper<Fn volatile>(cl));
+ test_b34<int const volatile&>(std::reference_wrapper<Fn const volatile>(cl));
+ }
+ {
+ typedef DerivedFromTestClass Fn;
+ Fn cl(42);
+ test_b34<int&>(std::reference_wrapper<Fn>(cl));
+ test_b34<int const&>(std::reference_wrapper<Fn const>(cl));
+ test_b34<int volatile&>(std::reference_wrapper<Fn volatile>(cl));
+ test_b34<int const volatile&>(std::reference_wrapper<Fn const volatile>(cl));
+ }
+ {
+ typedef TestClass Fn;
Fn cl_obj(42);
Fn* cl = &cl_obj;
test_b34<int&>(cl);
OpenPOWER on IntegriCloud