[cfe-commits] r70901 - in /cfe/trunk: lib/Sema/SemaDeclAttr.cpp test/SemaObjC/ignore-weakimport-method.m
Fariborz Jahanian
fjahanian at apple.com
Mon May 4 12:35:13 PDT 2009
Author: fjahanian
Date: Mon May 4 14:35:12 2009
New Revision: 70901
URL: http://llvm.org/viewvc/llvm-project?rev=70901&view=rev
Log:
ignore weak_import attribute on objc method decls.
Added:
cfe/trunk/test/SemaObjC/ignore-weakimport-method.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=70901&r1=70900&r2=70901&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon May 4 14:35:12 2009
@@ -775,8 +775,8 @@
isDef = (!VD->hasExternalStorage() || VD->getInit());
} else if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
isDef = FD->getBody(S.Context);
- } else if (isa<ObjCPropertyDecl>(D)) {
- // We ignore weak import on properties
+ } else if (isa<ObjCPropertyDecl>(D) || isa<ObjCMethodDecl>(D)) {
+ // We ignore weak import on properties and methods
return;
} else {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
Added: cfe/trunk/test/SemaObjC/ignore-weakimport-method.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/ignore-weakimport-method.m?rev=70901&view=auto
==============================================================================
--- cfe/trunk/test/SemaObjC/ignore-weakimport-method.m (added)
+++ cfe/trunk/test/SemaObjC/ignore-weakimport-method.m Mon May 4 14:35:12 2009
@@ -0,0 +1,7 @@
+// RUN: clang-cc -fsyntax-only -verify %s
+
+ at interface foo
++ (void) cx __attribute__((weak_import));
+- (void) x __attribute__((weak_import));
+ at end
+
More information about the cfe-commits
mailing list