[llvm-branch-commits] [cfe-branch] r125036 - in /cfe/branches/Apple/sill: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclAttr.cpp test/SemaObjC/ibaction.m

Daniel Dunbar daniel at zuster.org
Mon Feb 7 11:59:52 PST 2011


Author: ddunbar
Date: Mon Feb  7 13:59:52 2011
New Revision: 125036

URL: http://llvm.org/viewvc/llvm-project?rev=125036&view=rev
Log:
Merge r124858:
--
Author: Ted Kremenek <kremenek at apple.com>
Date:   Fri Feb 4 06:54:16 2011 +0000

    Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything but a instance method to a warning.

Modified:
    cfe/branches/Apple/sill/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/branches/Apple/sill/lib/Sema/SemaDeclAttr.cpp
    cfe/branches/Apple/sill/test/SemaObjC/ibaction.m

Modified: cfe/branches/Apple/sill/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/sill/include/clang/Basic/DiagnosticSemaKinds.td?rev=125036&r1=125035&r2=125036&view=diff
==============================================================================
--- cfe/branches/Apple/sill/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/branches/Apple/sill/include/clang/Basic/DiagnosticSemaKinds.td Mon Feb  7 13:59:52 2011
@@ -1108,9 +1108,9 @@
 
 
 // Clang-Specific Attributes
-def err_attribute_iboutlet : Error<
+def warn_attribute_iboutlet : Warning<
   "%0 attribute can only be applied to instance variables or properties">;
-def err_attribute_ibaction: Error<
+def warn_attribute_ibaction: Warning<
   "ibaction attribute can only be applied to Objective-C instance methods">;
 def err_attribute_overloadable_not_function : Error<
   "'overloadable' attribute can only be applied to a function">;

Modified: cfe/branches/Apple/sill/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/sill/lib/Sema/SemaDeclAttr.cpp?rev=125036&r1=125035&r2=125036&view=diff
==============================================================================
--- cfe/branches/Apple/sill/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/branches/Apple/sill/lib/Sema/SemaDeclAttr.cpp Mon Feb  7 13:59:52 2011
@@ -248,7 +248,7 @@
       return;
     }
 
-  S.Diag(Attr.getLoc(), diag::err_attribute_ibaction) << Attr.getName();
+  S.Diag(Attr.getLoc(), diag::warn_attribute_ibaction) << Attr.getName();
 }
 
 static void HandleIBOutlet(Decl *d, const AttributeList &Attr, Sema &S) {
@@ -265,7 +265,7 @@
     return;
   }
 
-  S.Diag(Attr.getLoc(), diag::err_attribute_iboutlet) << Attr.getName();
+  S.Diag(Attr.getLoc(), diag::warn_attribute_iboutlet) << Attr.getName();
 }
 
 static void HandleIBOutletCollection(Decl *d, const AttributeList &Attr,
@@ -280,7 +280,7 @@
   // The IBOutletCollection attributes only apply to instance variables of
   // Objective-C classes.
   if (!(isa<ObjCIvarDecl>(d) || isa<ObjCPropertyDecl>(d))) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_iboutlet) << Attr.getName();
+    S.Diag(Attr.getLoc(), diag::warn_attribute_iboutlet) << Attr.getName();
     return;
   }
   if (const ValueDecl *VD = dyn_cast<ValueDecl>(d))

Modified: cfe/branches/Apple/sill/test/SemaObjC/ibaction.m
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/sill/test/SemaObjC/ibaction.m?rev=125036&r1=125035&r2=125036&view=diff
==============================================================================
--- cfe/branches/Apple/sill/test/SemaObjC/ibaction.m (original)
+++ cfe/branches/Apple/sill/test/SemaObjC/ibaction.m Mon Feb  7 13:59:52 2011
@@ -4,10 +4,12 @@
 {
   __attribute__((iboutlet)) id myoutlet;
 }
++ (void) __attribute__((ibaction)) myClassMethod:(id)msg; // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
 - (void) __attribute__((ibaction)) myMessage:(id)msg;
 @end
 
 @implementation Foo
++ (void) __attribute__((ibaction)) myClassMethod:(id)msg {} // expected-warning{{ibaction attribute can only be applied to Objective-C instance methods}}
 // Normally attributes should not be attached to method definitions, but
 // we allow 'ibaction' to be attached because it can be expanded from
 // the IBAction macro.





More information about the llvm-branch-commits mailing list