Skip to content

Commit

Permalink
Remove EDG-related workaround for bit_cast (#733)
Browse files Browse the repository at this point in the history
This was Microsoft-internal VSO-1041044.
  • Loading branch information
barcharcraz committed Apr 22, 2020
1 parent b1c1861 commit 0cbd1b2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
2 changes: 0 additions & 2 deletions stl/inc/bit
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@ _STL_DISABLE_CLANG_WARNINGS
#undef new

_STD_BEGIN
#ifdef __cpp_lib_bit_cast // TRANSITION, VSO-1041044
template <class _To, class _From,
enable_if_t<conjunction_v<bool_constant<sizeof(_To) == sizeof(_From)>, is_trivially_copyable<_To>,
is_trivially_copyable<_From>>,
int> = 0>
_NODISCARD constexpr _To bit_cast(const _From& _Val) noexcept {
return __builtin_bit_cast(_To, _Val);
}
#endif // TRANSITION, VSO-1041044

#ifdef __cpp_lib_bitops // TRANSITION, VSO-1020212
template <class _Ty, enable_if_t<_Is_standard_unsigned_integer<_Ty>, int> = 0>
Expand Down
5 changes: 1 addition & 4 deletions stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,7 @@
#define __cpp_lib_atomic_float 201711L
#define __cpp_lib_atomic_shared_ptr 201711L
#define __cpp_lib_bind_front 201907L

#ifndef __EDG__ // TRANSITION, VSO-1041044
#define __cpp_lib_bit_cast 201806L
#endif // __EDG__
#define __cpp_lib_bit_cast 201806L

#ifdef __clang__ // TRANSITION, VSO-1020212
// a future MSVC update will embed CPU feature detection into <bit> intrinsics
Expand Down
5 changes: 0 additions & 5 deletions tests/std/tests/P0476R2_bit_cast/test.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
// Copyright (c) Microsoft Corporation.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifdef __EDG__ // TRANSITION, VSO-1041044
int main() {}
#else // __EDG__ ^^^ / vvv !__EDG__

#include <assert.h>
#include <bit>
#include <cmath>
Expand Down Expand Up @@ -263,4 +259,3 @@ int main() {
assert(test_float());
static_assert(test_float());
}
#endif // __EDG__
2 changes: 1 addition & 1 deletion tests/std/tests/VSO_0157762_feature_test_macros/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ STATIC_ASSERT(__cpp_lib_bind_front == 201907L);
#endif
#endif

#if _HAS_CXX20 && !defined(__EDG__) // TRANSITION, VSO-1041044
#if _HAS_CXX20
#ifndef __cpp_lib_bit_cast
#error __cpp_lib_bit_cast is not defined
#elif __cpp_lib_bit_cast != 201806L
Expand Down

0 comments on commit 0cbd1b2

Please sign in to comment.