[libcxx-commits] [PATCH] D144363: [libcxx] <experimental/simd> Added simd width functions, simd_size traits and related tests
Nikolas Klauser via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jul 11 14:37:24 PDT 2023
philnik added a comment.
In D144363#4488881 <https://reviews.llvm.org/D144363#4488881>, @Joy12138 wrote:
> @philnik Hi, we have added the SFINAE false test for `simd_size`. But the error messages seem not easy to read. Do you have any suggestions?
I think you did something wrong. You shouldn't need a `.verify.cpp` for SFINAE testing, and looking at the error message the types don't SFINAE away.
Something like
template <class T, class U, class = void>
struct check_sfinae : false_type {};
template <class T, class U>
struct check_sfinae<void_t<ex::simd_size<T, U>>> : true_type {};
static_assert(!check_sfinae<int , ex::native_simd<int>>::value);
should work just fine in a normal `.pass.cpp`. If you get an error, either I did something wrong in the SFINAE test, or the implementation of `ex::simd_size` is wrong (because it doesn't SFINAE away).
I'm pretty sure that variable templates can't SFINAE away.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D144363/new/
https://reviews.llvm.org/D144363
More information about the libcxx-commits
mailing list