[PATCH] D75737: [Sema][SVE] Don't allow fields to have sizeless type
Eli Friedman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 12 12:31:55 PDT 2020
efriedma accepted this revision.
efriedma added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: clang/lib/Sema/SemaLambda.cpp:1633
+ if (RequireCompleteSizedType(Loc, FieldType,
+ diag::err_field_incomplete_or_sizeless)) {
RD->setInvalidDecl();
----------------
rsandifo-arm wrote:
> 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.
Makes sense.
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