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 | 14da440018e0817c243f7d568092facba2bf4952 (patch) | |
| tree | 82a401a59578e13a519851da82c4b42017aa2d84 /clang/lib/Sema | |
| parent | 675444d5de4fb74d2827eee12cfe211a05007975 (diff) | |
| download | bcm5719-llvm-14da440018e0817c243f7d568092facba2bf4952.tar.gz bcm5719-llvm-14da440018e0817c243f7d568092facba2bf4952.zip | |
put back diagnostics when flexible members are captured
in lambdas.
llvm-svn: 171921
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 5b7a39674b0..96196e06931 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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(); } |

