Skip to content

Commit fea99cc

Browse files
[SYCL][NFC] Add MSVC narrowing bug comment (#8611)
Signed-off-by: Larsen, Steffen <[email protected]>
1 parent ccf205e commit fea99cc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sycl/include/sycl/detail/common.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,8 @@ template <typename DataT, template <typename, typename> typename FlattenF,
491491
struct ArrayCreator<DataT, FlattenF, ArgT, ArgTN...> {
492492
static constexpr auto Create(const ArgT &Arg, const ArgTN &...Args) {
493493
auto ImmArray = FlattenF<DataT, ArgT>()(Arg);
494+
// Due to a bug in MSVC narrowing size_t to a bool in an if constexpr causes
495+
// warnings. To avoid this we add the comparison to 0.
494496
if constexpr (sizeof...(Args) > 0)
495497
return ConcatArrays(
496498
ImmArray, ArrayCreator<DataT, FlattenF, ArgTN...>::Create(Args...));

0 commit comments

Comments
 (0)