Skip to content

Commit b551a58

Browse files
authored
Avoid sema error in test case (#12197)
This patch llvm/llvm-project#75332 would report narrowing conversions with const references, which could lead to "error: constant expression evaluates to 2 which cannot be narrowed to type 'bool'".
1 parent 19227c5 commit b551a58

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sycl/test/basic_tests/marray/marray.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ struct NotDefaultConstructible {
4444
};
4545

4646
template <typename T> void CheckBinOps() {
47-
sycl::marray<T, 3> ref_arr0{0};
48-
sycl::marray<T, 3> ref_arr1{1};
49-
sycl::marray<T, 3> ref_arr2{2};
50-
sycl::marray<T, 3> ref_arr3{3};
47+
sycl::marray<T, 3> ref_arr0{T(0)};
48+
sycl::marray<T, 3> ref_arr1{T(1)};
49+
sycl::marray<T, 3> ref_arr2{T(2)};
50+
sycl::marray<T, 3> ref_arr3{T(3)};
5151

5252
CHECK_BINOP(+, ref_arr1, ref_arr2)
5353
CHECK_BINOP(-, ref_arr1, ref_arr2)

0 commit comments

Comments
 (0)