Skip to content

Commit 66558d7

Browse files
authored
[libc++] Fix <__algorithm/find.h> when using -flax-vector-conversions=none (#161362)
1 parent 5f5a84e commit 66558d7

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

libcxx/include/__algorithm/find.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp* __find_vectorized(_Tp* __first, _Tp* __last,
6969

7070
auto __orig_first = __first;
7171

72-
auto __values = static_cast<__simd_vector<_Up, __vec_size>>(__value); // broadcast the value
72+
auto __values = static_cast<__simd_vector<_Tp, __vec_size>>(__value); // broadcast the value
7373
while (static_cast<size_t>(__last - __first) >= __unroll_count * __vec_size) [[__unlikely__]] {
7474
__vec __lhs[__unroll_count];
7575

libcxx/test/std/experimental/simd/simd.class/simd_unary.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// Assertion failed: N->getValueType(0) == MVT::v1i1 && "Expected v1i1 type"
1313
// XFAIL: target=armv7-unknown-linux-gnueabihf
1414

15+
// FIXME: This should work with -flax-vector-conversions=none
16+
// ADDITIONAL_COMPILE_FLAGS(clang): -flax-vector-conversions=integer
17+
1518
// <experimental/simd>
1619
//
1720
// [simd.class]

libcxx/utils/libcxx/test/params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575

7676
# We're not annotating all the APIs, since that's a lot of annotations compared to how many we actually care about
7777
"-Wno-nullability-completeness",
78+
79+
# Technically not a warning flag, but might as well be:
80+
"-flax-vector-conversions=none",
7881
]
7982

8083
_allStandards = ["c++03", "c++11", "c++14", "c++17", "c++20", "c++23", "c++26"]

0 commit comments

Comments
 (0)