Brought call_once variadic call up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@131414 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
index 68ee439..b4f76b4 100644
--- a/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
+++ b/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
@@ -129,6 +129,22 @@
std::call_once(flg41, init41);
}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+class MoveOnly
+{
+ MoveOnly(const MoveOnly&);
+public:
+ MoveOnly() {}
+ MoveOnly(MoveOnly&&) {}
+
+ void operator()(MoveOnly&&)
+ {
+ }
+};
+
+#endif
+
int main()
{
// check basic functionality
@@ -174,5 +190,9 @@
t1.join();
assert(init2::called == 5);
}
+ {
+ std::once_flag f;
+ std::call_once(f, MoveOnly(), MoveOnly());
+ }
#endif // _LIBCPP_HAS_NO_VARIADICS
}