summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-11-14 21:59:25 +0000
committerTed Kremenek <kremenek@apple.com>2011-11-14 21:59:25 +0000
commit1fcdaa9c058e65ca4251a3a752e42b5cbd1db736 (patch)
treec4f91aa23c68659656e58fc7392e751ee9bd936a /clang/lib/Sema/SemaExpr.cpp
parent8e7fbcc3e4713f72444f940fc5bf3ba33b9ddd06 (diff)
downloadbcm5719-llvm-1fcdaa9c058e65ca4251a3a752e42b5cbd1db736.tar.gz
bcm5719-llvm-1fcdaa9c058e65ca4251a3a752e42b5cbd1db736.zip
ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.
llvm-svn: 144572
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index d22a431d065..4f2f8c4eafd 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7063,7 +7063,9 @@ static bool CheckForModifiableLvalue(Expr *E, SourceLocation Loc, Sema &S) {
// - self
ObjCMethodDecl *method = S.getCurMethodDecl();
if (method && var == method->getSelfDecl())
- Diag = diag::err_typecheck_arr_assign_self;
+ Diag = method->isClassMethod()
+ ? diag::err_typecheck_arc_assign_self_class_method
+ : diag::err_typecheck_arc_assign_self;
// - fast enumeration variables
else
OpenPOWER on IntegriCloud