aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-01-04 00:31:53 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-01-04 00:31:53 +0000
commit9f37cd1810646ffc9002c7a6477fe158ee15ede4 (patch)
tree9265321431b28e39ffd53c18012f738a81232293 /lib/Sema/SemaObjCProperty.cpp
parent71523d6c41e1599fc42f420d02dd2895fd8f65d4 (diff)
In non-gc, non-arc mode, property of 'Class' type
variety is treated as a 'void *'. No need to issue warning reserved for objc object properties. // rdar://10565506 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index a15fc7dd8d..efef7caadc 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1797,6 +1797,14 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
// not specified; including when property is 'readonly'.
PropertyDecl->setPropertyAttributes(ObjCPropertyDecl::OBJC_PR_strong);
else if (!(Attributes & ObjCDeclSpec::DQ_PR_readonly)) {
+ bool isAnyClassTy =
+ (PropertyTy->isObjCClassType() ||
+ PropertyTy->isObjCQualifiedClassType());
+ // In non-gc, non-arc mode, 'Class' is treated as a 'void *' no need to
+ // issue any warning.
+ if (isAnyClassTy && getLangOptions().getGC() == LangOptions::NonGC)
+ ;
+ else {
// Skip this warning in gc-only mode.
if (getLangOptions().getGC() != LangOptions::GCOnly)
Diag(Loc, diag::warn_objc_property_no_assignment_attribute);
@@ -1804,6 +1812,7 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
// If non-gc code warn that this is likely inappropriate.
if (getLangOptions().getGC() == LangOptions::NonGC)
Diag(Loc, diag::warn_objc_property_default_assign_on_object);
+ }
}
// FIXME: Implement warning dependent on NSCopying being