]> granicus.if.org Git - clang/commitdiff
Downgrade error about attribute 'iboutlet' and 'ibaction' being applied to anything...
authorTed Kremenek <kremenek@apple.com>
Fri, 4 Feb 2011 06:54:16 +0000 (06:54 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 4 Feb 2011 06:54:16 +0000 (06:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124858 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/ibaction.m

index 0df95a254f94300d02c71e8d88b015dbb6de79da..b5e1b81bf8634387580f68b1251cbf636fe42a26 100644 (file)
@@ -1179,9 +1179,9 @@ def err_attribute_regparm_invalid_number : Error<
 
 
 // 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">;
index 09fdf8dca464ad250e7ac00afb5ecd281f797d6d..08a7c49d313613126ac5585e0e21cfd582f236a6 100644 (file)
@@ -255,7 +255,7 @@ static void HandleIBAction(Decl *d, const AttributeList &Attr, Sema &S) {
       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) {
@@ -272,7 +272,7 @@ static void HandleIBOutlet(Decl *d, const AttributeList &Attr, Sema &S) {
     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,
@@ -287,7 +287,7 @@ static void HandleIBOutletCollection(Decl *d, const AttributeList &Attr,
   // 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))
index b97e002833c98abb1454cf9eca480894190abe27..bcedf8334047a8e7bd270a80ba047907a5bc73b1 100644 (file)
@@ -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.