[Sema][SVE] Don't allow fields to have sizeless type
authorRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Feb 2020 16:14:55 +0000 (16:14 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 13 Mar 2020 19:22:23 +0000 (19:22 +0000)
commitb50d80c1ee1fc154c906f59a2ebedab2f85bacca
tree61c6f57477995655bc9ef2862192f13d705af0d2
parentadefcc8ab5be0b4d2e25356241987d923137ebb0
[Sema][SVE] Don't allow fields to have sizeless type

The SVE ACLE doesn't allow fields to have sizeless type.  At the moment
clang accepts things like:

  struct s { __SVInt8_t x; } y;

but trying to code-generate it leads to LLVM asserts like:

  llvm/include/llvm/Support/TypeSize.h:126: uint64_t llvm::TypeSize::getFixedSize() const: Assertion `!IsScalable && "Request for a fixed size on a scalable object"' failed.

This patch adds an associated clang diagnostic.

Differential Revision: https://reviews.llvm.org/D75737
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaLambda.cpp
clang/test/Sema/sizeless-1.c
clang/test/SemaCXX/sizeless-1.cpp