diff options
author | Howard Hinnant <hhinnant@apple.com> | 2011-05-16 18:40:35 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2011-05-16 18:40:35 +0000 |
commit | 8df61ea84d65ecfa9e78d8c6f7631d515d51d560 (patch) | |
tree | 0525fa4b150a211ab6083c3c1522ca42fd029229 /libcxx/test/thread/thread.threads | |
parent | 29fd504c091431cb03ba68e7e1a9cca99bab0de7 (diff) | |
download | bcm5719-llvm-8df61ea84d65ecfa9e78d8c6f7631d515d51d560.tar.gz bcm5719-llvm-8df61ea84d65ecfa9e78d8c6f7631d515d51d560.zip |
Brought thread variadic constructor up to current spec, which allows move-only functors and move-only arguments, but disallows functors with non-const lvalue reference parameters.
llvm-svn: 131413
Diffstat (limited to 'libcxx/test/thread/thread.threads')
-rw-r--r-- | libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp b/libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp index f41a70b9cfc..e5568bae29b 100644 --- a/libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp +++ b/libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.constr/F.pass.cpp @@ -71,6 +71,22 @@ public: int G::n_alive = 0; bool G::op_run = false; +#ifndef _LIBCPP_HAS_NO_VARIADICS + +class MoveOnly +{ + MoveOnly(const MoveOnly&); +public: + MoveOnly() {} + MoveOnly(MoveOnly&&) {} + + void operator()(MoveOnly&&) + { + } +}; + +#endif + int main() { { @@ -126,5 +142,9 @@ int main() assert(G::n_alive == 0); assert(G::op_run); } + { + std::thread t = std::thread(MoveOnly(), MoveOnly()); + t.join(); + } #endif // _LIBCPP_HAS_NO_VARIADICS } |