]> granicus.if.org Git - clang/commitdiff
Downgrade err_iboutlet_object_type to a warning. It was breaking a bunch of code...
authorTed Kremenek <kremenek@apple.com>
Tue, 1 Nov 2011 18:08:35 +0000 (18:08 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 1 Nov 2011 18:08:35 +0000 (18:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143470 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
test/SemaObjC/iboutletcollection-attr.m

index 1b1d0b151da02c6c5b8397fc8fee4c1faf0f7121..9041a768a7de6b1ae43d0571b5081bce6af486dd 100644 (file)
@@ -1695,9 +1695,10 @@ def warn_attribute_ibaction: Warning<
   "ibaction attribute can only be applied to Objective-C instance methods">;
 def err_iboutletcollection_type : Error<
   "invalid type %0 as argument of iboutletcollection attribute">;
-def err_iboutlet_object_type : Error<
+def warn_iboutlet_object_type : Warning<
   "%select{ivar|property}2 with %0 attribute must "
-  "be an object type (invalid %1)">;
+  "be an object type (invalid %1)">,
+  InGroup<DiagGroup<"invalid-iboutlet">>;
 def err_attribute_overloadable_not_function : Error<
   "'overloadable' attribute can only be applied to a function">;
 def err_attribute_overloadable_missing : Error<
index 9f025a2b76a228dda6446cc7687a136640767900..74d22e7efee449ad601ffbace4ea36f72d60f605 100644 (file)
@@ -760,14 +760,14 @@ static bool checkIBOutletCommon(Sema &S, Decl *D, const AttributeList &Attr) {
   // have an object reference type.
   if (const ObjCIvarDecl *VD = dyn_cast<ObjCIvarDecl>(D)) {
     if (!VD->getType()->getAs<ObjCObjectPointerType>()) {
-      S.Diag(Attr.getLoc(), diag::err_iboutlet_object_type)
+      S.Diag(Attr.getLoc(), diag::warn_iboutlet_object_type)
         << Attr.getName() << VD->getType() << 0;
       return false;
     }
   }
   else if (const ObjCPropertyDecl *PD = dyn_cast<ObjCPropertyDecl>(D)) {
     if (!PD->getType()->getAs<ObjCObjectPointerType>()) {
-      S.Diag(Attr.getLoc(), diag::err_iboutlet_object_type) 
+      S.Diag(Attr.getLoc(), diag::warn_iboutlet_object_type) 
         << Attr.getName() << PD->getType() << 1;
       return false;
     }
index 7caebb059ea11d7d07b639064e2fdd4c5bebdca9..22c21a764bdcd476dc089a2b230ad12d119ee87f 100644 (file)
@@ -21,14 +21,14 @@ typedef void *PV;
     __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute takes one argument}}
     __attribute__((iboutletcollection(B))) id ivar2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
     __attribute__((iboutletcollection(PV))) id ivar3; // expected-error {{invalid type 'PV' as argument of iboutletcollection attribute}}
-    __attribute__((iboutletcollection(PV))) void *ivar4; // expected-error {{ivar with 'iboutletcollection' attribute must be an object type (invalid 'void *')}}
+    __attribute__((iboutletcollection(PV))) void *ivar4; // expected-warning {{ivar with 'iboutletcollection' attribute must be an object type (invalid 'void *')}}
     __attribute__((iboutletcollection(int))) id ivar5; // expected-error {{type argument of iboutletcollection attribute cannot be a builtin type}}
-    __attribute__((iboutlet)) int ivar6;  // expected-error {{ivar with 'iboutlet' attribute must be an object type}}
+    __attribute__((iboutlet)) int ivar6;  // expected-warning {{ivar with 'iboutlet' attribute must be an object type}}
 }
 @property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute takes one argument}}
 @property (nonatomic, retain) __attribute__((iboutletcollection(B))) id prop2; // expected-error {{invalid type 'B' as argument of iboutletcollection attribute}}
 
-@property __attribute__((iboutletcollection(BAD))) int prop3; // expected-error {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
+@property __attribute__((iboutletcollection(BAD))) int prop3; // expected-warning {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
 @end
 
 // rdar://10296078