[PATCH] D75737: [Sema][SVE] Don't allow fields to have sizeless type

Richard Sandiford via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 12 11:23:52 PDT 2020


rsandifo-arm marked 2 inline comments as done.
rsandifo-arm added inline comments.


================
Comment at: clang/lib/Sema/SemaLambda.cpp:1633
+    if (RequireCompleteSizedType(Loc, FieldType,
+                                 diag::err_field_incomplete_or_sizeless)) {
       RD->setInvalidDecl();
----------------
efriedma wrote:
> Can BuildCaptureField actually print an error?  If it can, do you have a testcase?
Thanks for the reviews!

The only test I could find that triggered this was:

`auto bad_init_4 = [a(void_fn())] {}; // expected-error {{has incomplete type 'void'}}`

from CXX/expr/expr.prim/expr.prim.lambda/p11-1y.cpp.  This might not be the optimal way to report the problem though.

I've added a corresponding test for the sizeless case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75737/new/

https://reviews.llvm.org/D75737





More information about the cfe-commits mailing list