Merging r195146:
------------------------------------------------------------------------
r195146 | fjahanian | 2013-11-19 11:26:30 -0800 (Tue, 19 Nov 2013) | 4 lines
ObjectiveC ARC. Removes a bogus warning when a weak
property is redeclared as 'weak' in class extension.
// rdar://15465916
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195224 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 9d18c65..d9d9cec 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -463,10 +463,12 @@
QualType PrimaryPropertyQT =
Context.getCanonicalType(PIDecl->getType()).getUnqualifiedType();
if (isa<ObjCObjectPointerType>(PrimaryPropertyQT)) {
+ bool PropertyIsWeak = ((PIkind & ObjCPropertyDecl::OBJC_PR_weak) != 0);
Qualifiers::ObjCLifetime PrimaryPropertyLifeTime =
PrimaryPropertyQT.getObjCLifetime();
if (PrimaryPropertyLifeTime == Qualifiers::OCL_None &&
- (Attributes & ObjCDeclSpec::DQ_PR_weak)) {
+ (Attributes & ObjCDeclSpec::DQ_PR_weak) &&
+ !PropertyIsWeak) {
Diag(AtLoc, diag::warn_property_implicitly_mismatched);
Diag(PIDecl->getLocation(), diag::note_property_declare);
}