diff options
| author | Howard Hinnant <hhinnant@apple.com> | 2011-05-16 19:05:11 +0000 |
|---|---|---|
| committer | Howard Hinnant <hhinnant@apple.com> | 2011-05-16 19:05:11 +0000 |
| commit | 872a91167ebe2780f0b899c392bce491a0573bfa (patch) | |
| tree | 76f7a98764611f846691586c0b58ab603a378f0d /libcxx/test/thread | |
| parent | 8df61ea84d65ecfa9e78d8c6f7631d515d51d560 (diff) | |
| download | bcm5719-llvm-872a91167ebe2780f0b899c392bce491a0573bfa.tar.gz bcm5719-llvm-872a91167ebe2780f0b899c392bce491a0573bfa.zip | |
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.
llvm-svn: 131414
Diffstat (limited to 'libcxx/test/thread')
| -rw-r--r-- | libcxx/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libcxx/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/libcxx/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp index 68ee43946b4..b4f76b45c5b 100644 --- a/libcxx/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp +++ b/libcxx/test/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp @@ -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 } |

