Skip to content

Commit

Permalink
[SYCL] Use explicit return type in get_vec_idx helper (#16464)
Browse files Browse the repository at this point in the history
Apparently, some versions of MSVC (e.g. 14.29.30133) fail to compile it

```
error C3779: 'sycl::_V1::detail::SwizzleOp<VecT,OperationLeftT,OperationRightT,OperationCurrentT,Indexes...>::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.
  • Loading branch information
aelovikov-intel authored Dec 24, 2024
1 parent 7f9887a commit a62b220
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sycl/include/sycl/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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), ...);
Expand Down

0 comments on commit a62b220

Please sign in to comment.