[cfe-commits] r67205 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/property-weak.m

Mike Stump mrs at apple.com
Wed Mar 18 08:05:17 PDT 2009


Author: mrs
Date: Wed Mar 18 10:05:17 2009
New Revision: 67205

URL: http://llvm.org/viewvc/llvm-project?rev=67205&view=rev
Log:
Ignore weak import on properties.

Added:
    cfe/trunk/test/SemaObjC/property-weak.m
Modified:
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=67205&r1=67204&r2=67205&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Mar 18 10:05:17 2009
@@ -761,6 +761,8 @@
     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*/;

Added: cfe/trunk/test/SemaObjC/property-weak.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-weak.m?rev=67205&view=auto

==============================================================================
--- cfe/trunk/test/SemaObjC/property-weak.m (added)
+++ cfe/trunk/test/SemaObjC/property-weak.m Wed Mar 18 10:05:17 2009
@@ -0,0 +1,5 @@
+// RUN: clang -triple i386-apple-darwin9 -fsyntax-only -verify %s
+
+ at interface foo
+ at property(nonatomic) int foo __attribute__((weak_import));
+ at end





More information about the cfe-commits mailing list