From: Fariborz Jahanian Date: Thu, 26 Sep 2013 22:43:41 +0000 (+0000) Subject: ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1ebccd82bbef0547fe1a8d14d2e74e7570be8ab;p=clang ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER on class methods, as it makes no sense. // rdar://15069200 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191468 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 997f951d7c..ca1d189ca3 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/lib/ARCMigrate/ObjCMT.cpp @@ -846,6 +846,7 @@ bool ObjCMigrateASTConsumer::migrateProperty(ASTContext &Ctx, void ObjCMigrateASTConsumer::migrateNsReturnsInnerPointer(ASTContext &Ctx, ObjCMethodDecl *OM) { if (OM->isImplicit() || + !OM->isInstanceMethod() || OM->hasAttr()) return; diff --git a/test/ARCMT/objcmt-ns-returns-inner-pointer.m b/test/ARCMT/objcmt-ns-returns-inner-pointer.m index 42cbdb8e51..147de16e8e 100644 --- a/test/ARCMT/objcmt-ns-returns-inner-pointer.m +++ b/test/ARCMT/objcmt-ns-returns-inner-pointer.m @@ -122,6 +122,8 @@ typedef void *SecTrustRef; - (SecTrustRef) FOO1 NS_AVAILABLE; ++ (const NSURLProtectionSpace *)ProtectionSpace; + // pointer personality functions @property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item)); @end diff --git a/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result b/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result index 389cb8853a..ea5becc563 100644 --- a/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result +++ b/test/ARCMT/objcmt-ns-returns-inner-pointer.m.result @@ -122,6 +122,8 @@ typedef void *SecTrustRef; - (SecTrustRef) FOO1 NS_AVAILABLE NS_RETURNS_INNER_POINTER; ++ (const NSURLProtectionSpace *)ProtectionSpace; + // pointer personality functions @property NSUInteger (*hashFunction)(const void *item, NSUInteger (*size)(const void *item)); @end