summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2015-04-16 18:38:44 +0000
committerFariborz Jahanian <fjahanian@apple.com>2015-04-16 18:38:44 +0000
commit7a60b6db76f5d2be3f42eb5d6b94aa758a7d78de (patch)
tree3d3f2d7e454338f843b97ec69a3c42473f50b72d /clang/lib/Sema/SemaDeclObjC.cpp
parent71ba347925449f5bee08544a5165f01583ad9c73 (diff)
downloadbcm5719-llvm-7a60b6db76f5d2be3f42eb5d6b94aa758a7d78de.tar.gz
bcm5719-llvm-7a60b6db76f5d2be3f42eb5d6b94aa758a7d78de.zip
[Objective-C Sema] patch to introduce IndependentClass
attribute to be placed on Objective-C pointer typedef to make them strong enough so on their "new" method family no attempt is made to override these types. rdar://20255473 llvm-svn: 235128
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 256419353c8..dc47ce966f7 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -3299,7 +3299,7 @@ Decl *Sema::ActOnMethodDeclaration(
case OMF_alloc:
case OMF_new:
- InferRelatedResultType = ObjCMethod->isClassMethod();
+ InferRelatedResultType = ObjCMethod->isClassMethod();
break;
case OMF_init:
@@ -3310,7 +3310,8 @@ Decl *Sema::ActOnMethodDeclaration(
break;
}
- if (InferRelatedResultType)
+ if (InferRelatedResultType &&
+ !ObjCMethod->getReturnType()->isObjCIndependentClassType())
ObjCMethod->SetRelatedResultType();
}
OpenPOWER on IntegriCloud