diff options
author | Ted Kremenek <kremenek@apple.com> | 2011-11-14 21:59:25 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2011-11-14 21:59:25 +0000 |
commit | 2bbcd5ce370753c86d312d2c72a97476ac35b073 (patch) | |
tree | 013bd55a1496cb2af875ba9e7a8d3fe0aefd498e /lib/Sema/SemaExpr.cpp | |
parent | 4c42bb7815e4f6317826767f8c53776ae03b4028 (diff) |
ARC: make assignment to 'self' within class methods illegal. Fixes <rdar://problem/10416568>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index d22a431d06..4f2f8c4eaf 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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 |