summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2013-07-02 18:01:41 +0000
committerHoward Hinnant <hhinnant@apple.com>2013-07-02 18:01:41 +0000
commit3fc9ef22b3697a77aca829991482c5fd1a6732bc (patch)
tree8f2d0e859b755b62ac93d53b1d40b6d7455fd001
parentca69356d52bd1f1abfd57686be5fb13648fb9e46 (diff)
downloadbcm5719-llvm-3fc9ef22b3697a77aca829991482c5fd1a6732bc.tar.gz
bcm5719-llvm-3fc9ef22b3697a77aca829991482c5fd1a6732bc.zip
Constrain launch ~ operator to defined bits.
llvm-svn: 185452
-rw-r--r--libcxx/include/future2
-rw-r--r--libcxx/test/thread/futures/futures.overview/launch.pass.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/include/future b/libcxx/include/future
index 160114e5901..dae1a4b805e 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -443,7 +443,7 @@ _LIBCPP_CONSTEXPR
launch
operator~(launch __x)
{
- return static_cast<launch>(~static_cast<__launch_underlying_type>(__x));
+ return static_cast<launch>(~static_cast<__launch_underlying_type>(__x) & 3);
}
inline _LIBCPP_INLINE_VISIBILITY
diff --git a/libcxx/test/thread/futures/futures.overview/launch.pass.cpp b/libcxx/test/thread/futures/futures.overview/launch.pass.cpp
index d634c8b54c3..5f4663ca5a0 100644
--- a/libcxx/test/thread/futures/futures.overview/launch.pass.cpp
+++ b/libcxx/test/thread/futures/futures.overview/launch.pass.cpp
@@ -28,7 +28,7 @@ int main()
static_assert(std::launch::any == (std::launch::async | std::launch::deferred), "");
static_assert(std::launch(0) == (std::launch::async & std::launch::deferred), "");
static_assert(std::launch::any == (std::launch::async ^ std::launch::deferred), "");
- static_assert(std::launch(~1) == ~std::launch::async, "");
+ static_assert(std::launch::deferred == ~std::launch::async, "");
std::launch x = std::launch::async;
x &= std::launch::deferred;
assert(x == std::launch(0));
OpenPOWER on IntegriCloud