aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2010-01-05 03:10:36 +0000
committerMike Stump <mrs@apple.com>2010-01-05 03:10:36 +0000
commit2849734790738585a9726a84b263c60e3be0193f (patch)
tree84d8fb8257a50fedd61546b9d489f8096a7e2e89 /lib/Sema/SemaExpr.cpp
parent0d6fd570e52f5d7fc637c9f41382992a97b94b4c (diff)
Disallow captured arrays in blocks as well. Radar 7438948.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index f0d39dde9f..3d2ee74278 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -1537,6 +1537,12 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
return ExprError();
}
+ if (VD->getType()->isArrayType()) {
+ Diag(Loc, diag::err_ref_array_type);
+ Diag(D->getLocation(), diag::note_declared_at);
+ return ExprError();
+ }
+
MarkDeclarationReferenced(Loc, VD);
QualType ExprTy = VD->getType().getNonReferenceType();
// The BlocksAttr indicates the variable is bound by-reference.