aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/ScopeInfo.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-08-28 04:28:19 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-08-28 04:28:19 +0000
commit39c81e281629886bfa491434e31516b2056d0985 (patch)
treeb0b1ff5b7d83d851e804aad3c20379024760bb7b /clang/lib/Sema/ScopeInfo.cpp
parentc5cafbb074d216d6fa6bc5beb05f236e736490d2 (diff)
downloadllvm-39c81e281629886bfa491434e31516b2056d0985.zip
llvm-39c81e281629886bfa491434e31516b2056d0985.tar.gz
llvm-39c81e281629886bfa491434e31516b2056d0985.tar.bz2
[C++11] Support for capturing of variable length arrays in lambda expression.
Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
Diffstat (limited to 'clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r--clang/lib/Sema/ScopeInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp
index 4d079e7..259cd67 100644
--- a/clang/lib/Sema/ScopeInfo.cpp
+++ b/clang/lib/Sema/ScopeInfo.cpp
@@ -14,6 +14,7 @@
#include "clang/Sema/ScopeInfo.h"
#include "clang/AST/Decl.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ExprCXX.h"
@@ -93,6 +94,15 @@ FunctionScopeInfo::WeakObjectProfileTy::getBaseInfo(const Expr *E) {
return BaseInfoTy(D, IsExact);
}
+bool CapturingScopeInfo::isVLATypeCaptured(const VariableArrayType *VAT) const {
+ if (auto *LSI = dyn_cast<LambdaScopeInfo>(this))
+ for (auto *FD : LSI->Lambda->fields()) {
+ if (FD->hasCapturedVLAType() && FD->getCapturedVLAType() == VAT)
+ return true;
+ }
+ return false;
+}
+
FunctionScopeInfo::WeakObjectProfileTy::WeakObjectProfileTy(
const ObjCPropertyRefExpr *PropE)
: Base(nullptr, true), Property(getBestPropertyDecl(PropE)) {