Make sure we look through categories when searching for a classes property.
Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51925 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index 701ad35..e493d27 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -150,6 +150,13 @@
if (property->getIdentifier() == PropertyId)
return property;
}
+ // Look through categories.
+ for (ObjCCategoryDecl *Category = getCategoryList();
+ Category; Category = Category->getNextClassCategory()) {
+ ObjCPropertyDecl *property = Category->FindPropertyDeclaration(PropertyId);
+ if (property)
+ return property;
+ }
if (getSuperClass())
return getSuperClass()->FindPropertyDeclaration(PropertyId);
return 0;