diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-09 00:09:15 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-01-09 00:09:15 +0000 |
commit | e178e70e14380cf8828a307f912fcdbd3882b752 (patch) | |
tree | 740eea36d1c92c8099b1725853bf2a02005927c8 /lib/Sema/SemaExpr.cpp | |
parent | 080dc528c7016a107b94430b84cee6ad33e09155 (diff) |
put back diagnostics when flexible members are captured
in lambdas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 5b7a39674b..96196e0693 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -10762,10 +10762,13 @@ bool Sema::tryCaptureVariable(VarDecl *Var, SourceLocation Loc, // Prohibit structs with flexible array members too. // We cannot capture what is in the tail end of the struct. if (const RecordType *VTTy = Var->getType()->getAs<RecordType>()) { - if (VTTy->getDecl()->hasFlexibleArrayMember() && IsBlock) { + if (VTTy->getDecl()->hasFlexibleArrayMember()) { if (BuildAndDiagnose) { if (IsBlock) Diag(Loc, diag::err_ref_flexarray_type); + else + Diag(Loc, diag::err_lambda_capture_flexarray_type) + << Var->getDeclName(); Diag(Var->getLocation(), diag::note_previous_decl) << Var->getDeclName(); } |