]> granicus.if.org Git - clang/commitdiff
Ignore weak import on properties.
authorMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 15:05:17 +0000 (15:05 +0000)
committerMike Stump <mrs@apple.com>
Wed, 18 Mar 2009 15:05:17 +0000 (15:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/property-weak.m [new file with mode: 0644]

index 96812018a1931fccd55db82f5cb68ee53cd69064..174bfc62649e20b6be29b4229bc1cc4fd17e1e5e 100644 (file)
@@ -761,6 +761,8 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
     isDef = (!VD->hasExternalStorage() || VD->getInit());
   } else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
     isDef = FD->getBody();
+  } else if (isa<ObjCPropertyDecl>(D)) {
+    // We ignore weak import on properties
   } else {
     S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
     << "weak_import" << 2 /*variable and function*/;
diff --git a/test/SemaObjC/property-weak.m b/test/SemaObjC/property-weak.m
new file mode 100644 (file)
index 0000000..2e5edbd
--- /dev/null
@@ -0,0 +1,5 @@
+// RUN: clang -triple i386-apple-darwin9 -fsyntax-only -verify %s
+
+@interface foo
+@property(nonatomic) int foo __attribute__((weak_import));
+@end