diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-10 21:58:04 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-10-10 21:58:04 +0000 |
| commit | 8bcf182b9df69e829aa16179b7f77b02511151f4 (patch) | |
| tree | c579ae5c487697a56fdbdea1e0775bbfd5595d96 /clang/lib/Sema/SemaStmt.cpp | |
| parent | f6fe6bfffeefdd569fd3c52b681a11a777c2a738 (diff) | |
| download | bcm5719-llvm-8bcf182b9df69e829aa16179b7f77b02511151f4.tar.gz bcm5719-llvm-8bcf182b9df69e829aa16179b7f77b02511151f4.zip | |
ObjectiveC. ObjectiveC's collection selector expression in
the fereach loop must be a non-const lvalue expression as
it will be assigned to at the beginning of the loop.
// rdar://15123684
llvm-svn: 192399
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index 10e808eae31..2977404445a 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -1711,6 +1711,9 @@ Sema::ActOnObjCForCollectionStmt(SourceLocation ForLoc, << First->getSourceRange()); FirstType = static_cast<Expr*>(First)->getType(); + if (FirstType.isConstQualified()) + Diag(ForLoc, diag::err_selector_element_const_type) + << FirstType << First->getSourceRange(); } if (!FirstType->isDependentType() && !FirstType->isObjCObjectPointerType() && |

