[Sema][SVE] Reject arrays of sizeless types
The SVE ACLE doesn't allow arrays of sizeless types. At the moment
clang accepts the TU:
but trying to code-generate it triggers the LLVM assertion:
llvm/lib/IR/Type.cpp:588: static llvm::ArrayType* llvm::ArrayType::get(llvm::Type*, uint64_t): Assertion `isValidElementType(ElementType) && "Invalid type for array element!"' failed.
This patch reports an appropriate error instead.
The rules are slightly more restrictive than for general incomplete types.
struct s; typedef struct s arr;
is valid as far as it goes, whereas arrays of sizeless types are
invalid in all contexts. BuildArrayType therefore needs a specific
check for isSizelessType in addition to the usual handling of
Differential Revision: https://reviews.llvm.org/D76082