From a62b2206004e1931833da43292e77b4edf406326 Mon Sep 17 00:00:00 2001 From: aelovikov-intel Date: Tue, 24 Dec 2024 08:24:38 -0800 Subject: [PATCH] [SYCL] Use explicit return type in `get_vec_idx` helper (#16464) Apparently, some versions of MSVC (e.g. 14.29.30133) fail to compile it ``` error C3779: 'sycl::_V1::detail::SwizzleOp::get_vec_idx': a function that returns 'auto' cannot be used before it is defined ``` when used with `-fsycl-host-compiler`. This has been caught by the existing `bit_cast_win.cpp` test in a downstream environment. --- sycl/include/sycl/vector.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/vector.hpp b/sycl/include/sycl/vector.hpp index 82ce6b676eb75..3c5e7c3a305b6 100644 --- a/sycl/include/sycl/vector.hpp +++ b/sycl/include/sycl/vector.hpp @@ -1181,7 +1181,7 @@ class SwizzleOp : public detail::NamedSwizzlesMixinBoth< } private: - static constexpr auto get_vec_idx(int idx) { + static constexpr int get_vec_idx(int idx) { int counter = 0; int result = -1; ((result = counter++ == idx ? Indexes : result), ...);