diff --git a/sycl/include/sycl/vector_preview.hpp b/sycl/include/sycl/vector_preview.hpp index d0549dbefd817..e374e0309445c 100644 --- a/sycl/include/sycl/vector_preview.hpp +++ b/sycl/include/sycl/vector_preview.hpp @@ -489,9 +489,9 @@ class vec : public detail::vec_arith { !std::is_same_v; if constexpr (canUseNativeVectorConvert) { - Result.m_Data = sycl::bit_cast( - detail::convertImpl(NativeVector)); + auto val = detail::convertImpl(NativeVector); + Result.m_Data = sycl::bit_cast(val); } else #endif // __SYCL_DEVICE_ONLY__ {