[PATCH] D131058: [AArch64] Add an error if SVE scalable vector types are used in a context without sve
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 12 09:01:51 PDT 2022
dmgreen added inline comments.
================
Comment at: clang/test/Sema/arm-sve-target.cpp:25
+__SVFloat32_t other_ret();
+__SVFloat32_t test_ret() { // expected-error {{SVE vector type '__SVFloat32_t' cannot be used in a target without sve}}
+ return other_ret();
----------------
sdesmalen wrote:
> Does this implementation still allow pointers to these types?
>
> For example, it is possible to do:
> ```void foo(struct bar *&ptrA, struct bar *&ptrB) {
> std::swap(ptrA, ptrB);
> }
> ```
> without having defined bar, because it's operating purely on pointers. I would expect the same behaviour for the SVE types, because it doesn't really need SVE to do this operation.
It seems to be fine. It works the same as this, without any extra warnings/errors: https://godbolt.org/z/h978aMPMb
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131058/new/
https://reviews.llvm.org/D131058
More information about the llvm-commits
mailing list