aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaObjCProperty.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-10 21:53:24 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-10 21:53:24 +0000
commit9d1bbeab2475fe45a3d4cb8de6810bc3275f1dd7 (patch)
treec9abddbbab2b06fcb1f0e2df071b24edb0a19261 /lib/Sema/SemaObjCProperty.cpp
parentc91562ce427a88f4aa4d6c2b374f6f0937f5b6fc (diff)
objc: err on a property designated both atomic and
nonatomic. // rdar://10260017 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaObjCProperty.cpp')
-rw-r--r--lib/Sema/SemaObjCProperty.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 727c7b8b64..df95396ee4 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -1744,6 +1744,13 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
Attributes &= ~ObjCDeclSpec::DQ_PR_weak;
}
+ if ((Attributes & ObjCDeclSpec::DQ_PR_atomic) &&
+ (Attributes & ObjCDeclSpec::DQ_PR_nonatomic)) {
+ Diag(Loc, diag::err_objc_property_attr_mutually_exclusive)
+ << "atomic" << "nonatomic";
+ Attributes &= ~ObjCDeclSpec::DQ_PR_atomic;
+ }
+
// Warn if user supplied no assignment attribute, property is
// readwrite, and this is an object type.
if (!(Attributes & (ObjCDeclSpec::DQ_PR_assign | ObjCDeclSpec::DQ_PR_copy |