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
This commit is contained in:
@@ -129,6 +129,22 @@ void f42()
|
||||
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 @@ int main()
|
||||
t1.join();
|
||||
assert(init2::called == 5);
|
||||
}
|
||||
{
|
||||
std::once_flag f;
|
||||
std::call_once(f, MoveOnly(), MoveOnly());
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_VARIADICS
|
||||
}
|
||||
|
Reference in New Issue
Block a user