diff options
author | John McCall <rjmccall@apple.com> | 2013-04-04 01:38:37 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2013-04-04 01:38:37 +0000 |
commit | e48f389ce6c1990b5e92e5d13b81405a7ec679de (patch) | |
tree | 3966758e69f3bd7d9eefc86320e7001e00de62bf /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 5a2af525abed522d3d03f2729d42d22784d8e413 (diff) | |
download | bcm5719-llvm-e48f389ce6c1990b5e92e5d13b81405a7ec679de.tar.gz bcm5719-llvm-e48f389ce6c1990b5e92e5d13b81405a7ec679de.zip |
Be sure to check ARC conventions on the implicit method declarations
of a property just in case the property's getter happens to be +1.
We won't synthesize a getter for such a property, but we will allow
the user to define a +1 method for it.
rdar://13115896
llvm-svn: 178731
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index 824a249084c..68fb07f8feb 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1936,6 +1936,9 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, if (property->hasAttr<NSReturnsNotRetainedAttr>()) GetterMethod->addAttr( ::new (Context) NSReturnsNotRetainedAttr(Loc, Context)); + + if (getLangOpts().ObjCAutoRefCount) + CheckARCMethodDecl(GetterMethod); } else // A user declared getter will be synthesize when @synthesize of // the property with the same name is seen in the @implementation @@ -1984,6 +1987,11 @@ void Sema::ProcessPropertyDecl(ObjCPropertyDecl *property, // and the real context should be the same. if (lexicalDC) SetterMethod->setLexicalDeclContext(lexicalDC); + + // It's possible for the user to have set a very odd custom + // setter selector that causes it to have a method family. + if (getLangOpts().ObjCAutoRefCount) + CheckARCMethodDecl(SetterMethod); } else // A user declared setter will be synthesize when @synthesize of // the property with the same name is seen in the @implementation |