summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/ARCMigrate/ObjCMT.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp
index 706a4ec1065..c8fc312e6a2 100644
--- a/clang/lib/ARCMigrate/ObjCMT.cpp
+++ b/clang/lib/ARCMigrate/ObjCMT.cpp
@@ -628,7 +628,9 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx,
ObjCContainerDecl *CDecl,
ObjCMethodDecl *OM,
ObjCInstanceTypeFamily OIT_Family) {
- if (OM->isInstanceMethod() || !OM->getResultType()->isObjCIdType())
+ if (OM->isInstanceMethod() ||
+ OM->getResultType() == Ctx.getObjCInstanceType() ||
+ !OM->getResultType()->isObjCIdType())
return;
// Candidate factory methods are + (id) NaMeXXX : ... which belong to a class
OpenPOWER on IntegriCloud