Skip to content

Commit d8fea22

Browse files
authored
[SYCL] Update bit_ast to build with gcc 7 (#3238)
1 parent 6b9b16c commit d8fea22

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sycl/include/CL/sycl/detail/helpers.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ inline void memcpy(void *Dst, const void *Src, size_t Size) {
4646
}
4747

4848
template <typename To, typename From>
49-
constexpr To bit_cast(const From &from) noexcept {
49+
#if __cpp_lib_bit_cast || __has_builtin(__builtin_bit_cast)
50+
constexpr
51+
#endif
52+
To
53+
bit_cast(const From &from) noexcept {
5054
static_assert(sizeof(To) == sizeof(From),
5155
"Sizes of To and From must be equal");
5256
static_assert(std::is_trivially_copyable<From>::value,

0 commit comments

Comments
 (0)