diff options
| author | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2017-02-05 22:48:07 +0000 | 
|---|---|---|
| committer | Stephan T. Lavavej <stl@exchange.microsoft.com> | 2017-02-05 22:48:07 +0000 | 
| commit | 0d6482f3bb9808c7246305884d18645362cd2f93 (patch) | |
| tree | d2fd3c85768acc24bd3313148da423dd71ffe5a2 /libcxx/test/std/thread | |
| parent | 3c56112e3ffbedce6d424c07ef14e7b851385c12 (diff) | |
| download | bcm5719-llvm-0d6482f3bb9808c7246305884d18645362cd2f93.tar.gz bcm5719-llvm-0d6482f3bb9808c7246305884d18645362cd2f93.zip  | |
[libcxx] [test] Fix Clang -Wpessimizing-move "moving a temporary object prevents copy elision".
N4618 30.6.6 [futures.unique_future]/12 declares "shared_future<R> share() noexcept;".
Fixes D29139.
llvm-svn: 294158
Diffstat (limited to 'libcxx/test/std/thread')
| -rw-r--r-- | libcxx/test/std/thread/futures/futures.unique_future/share.pass.cpp | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/libcxx/test/std/thread/futures/futures.unique_future/share.pass.cpp b/libcxx/test/std/thread/futures/futures.unique_future/share.pass.cpp index 2e4c332f281..9b8667e538c 100644 --- a/libcxx/test/std/thread/futures/futures.unique_future/share.pass.cpp +++ b/libcxx/test/std/thread/futures/futures.unique_future/share.pass.cpp @@ -26,7 +26,7 @@ int main()          std::promise<T> p;          std::future<T> f0 = p.get_future();          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(f.valid());      } @@ -34,7 +34,7 @@ int main()          typedef int T;          std::future<T> f0;          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(!f.valid());      } @@ -43,7 +43,7 @@ int main()          std::promise<T> p;          std::future<T> f0 = p.get_future();          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(f.valid());      } @@ -51,7 +51,7 @@ int main()          typedef int& T;          std::future<T> f0;          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(!f.valid());      } @@ -60,7 +60,7 @@ int main()          std::promise<T> p;          std::future<T> f0 = p.get_future();          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(f.valid());      } @@ -68,7 +68,7 @@ int main()          typedef void T;          std::future<T> f0;          static_assert( noexcept(f0.share()), ""); -        std::shared_future<T> f = std::move(f0.share()); +        std::shared_future<T> f = f0.share();          assert(!f0.valid());          assert(!f.valid());      }  | 

