aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-02-21 16:14:55 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2020-03-13 19:22:23 +0000
commitb50d80c1ee1fc154c906f59a2ebedab2f85bacca (patch)
tree61c6f57477995655bc9ef2862192f13d705af0d2 /clang/lib/Sema/SemaLambda.cpp
parentadefcc8ab5be0b4d2e25356241987d923137ebb0 (diff)
downloadllvm-b50d80c1ee1fc154c906f59a2ebedab2f85bacca.zip
llvm-b50d80c1ee1fc154c906f59a2ebedab2f85bacca.tar.gz
llvm-b50d80c1ee1fc154c906f59a2ebedab2f85bacca.tar.bz2
[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
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 51f643e..ab4f349 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -1629,7 +1629,8 @@ FieldDecl *Sema::BuildCaptureField(RecordDecl *RD,
// If the variable being captured has an invalid type, mark the class as
// invalid as well.
if (!FieldType->isDependentType()) {
- if (RequireCompleteType(Loc, FieldType, diag::err_field_incomplete)) {
+ if (RequireCompleteSizedType(Loc, FieldType,
+ diag::err_field_incomplete_or_sizeless)) {
RD->setInvalidDecl();
Field->setInvalidDecl();
} else {