forked from OSchip/llvm-project
Constrain launch ~ operator to defined bits.
llvm-svn: 185452
This commit is contained in:
parent
ca69356d52
commit
3fc9ef22b3
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue