summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaAccess.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-02-15 16:57:26 +0000
committerDouglas Gregor <dgregor@apple.com>2012-02-15 16:57:26 +0000
commit19666fb1aa7dd4428ec9eef4d880acf1c658cc37 (patch)
treea6c632a35985a9e8507579f3878d052644dcb185 /clang/lib/Sema/SemaAccess.cpp
parenta9ed5d76b43db7a95e96dac8e4958fbb666a3af2 (diff)
downloadbcm5719-llvm-19666fb1aa7dd4428ec9eef4d880acf1c658cc37.tar.gz
bcm5719-llvm-19666fb1aa7dd4428ec9eef4d880acf1c658cc37.zip
Introduce a new initialization entity for lambda captures, and
specialize location information and diagnostics for this entity. llvm-svn: 150588
Diffstat (limited to 'clang/lib/Sema/SemaAccess.cpp')
-rw-r--r--clang/lib/Sema/SemaAccess.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaAccess.cpp b/clang/lib/Sema/SemaAccess.cpp
index 03eb4c3142f..57d5e43f968 100644
--- a/clang/lib/Sema/SemaAccess.cpp
+++ b/clang/lib/Sema/SemaAccess.cpp
@@ -1481,6 +1481,13 @@ Sema::AccessResult Sema::CheckConstructorAccess(SourceLocation UseLoc,
break;
}
+ case InitializedEntity::EK_LambdaCapture: {
+ const VarDecl *Var = Entity.getCapturedVar();
+ PD = PDiag(diag::err_access_lambda_capture);
+ PD << Var->getName() << Entity.getType() << getSpecialMember(Constructor);
+ break;
+ }
+
}
return CheckConstructorAccess(UseLoc, Constructor, Access, PD);
OpenPOWER on IntegriCloud