aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2008-11-20 00:15:42 +0000
committerFariborz Jahanian <fjahanian@apple.com>2008-11-20 00:15:42 +0000
commit2682d8b3a0415d521d5ca11afb13a8bc5c559a31 (patch)
tree3b7fed35f05db16b71b1d20356820801d3f59285 /lib/Sema/SemaDeclAttr.cpp
parent9ebae31a97f862771dc5f6bd4923dd97131fed71 (diff)
More objc gc stuff. Read/Write barriers for local static/extern,
diagnostics on use of __weak attribute on fields, Early support for read/write barriers for objc fields. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59682 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 4bf55dd7f0..57d1cc7fa0 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -555,8 +555,11 @@ static void HandleObjCGCAttr(Decl *d, const AttributeList &Attr, Sema &S) {
ObjCGCAttr::GCAttrTypes type;
- if (Attr.getParameterName()->isName("weak"))
+ if (Attr.getParameterName()->isName("weak")) {
+ if (isa<FieldDecl>(d))
+ S.Diag(Attr.getLoc(), diag::warn_attribute_weak_on_field);
type = ObjCGCAttr::Weak;
+ }
else if (Attr.getParameterName()->isName("strong"))
type = ObjCGCAttr::Strong;
else {