[cfe-commits] r143470 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclAttr.cpp test/SemaObjC/iboutletcollection-attr.m

Ted Kremenek kremenek at apple.com
Tue Nov 1 11:08:35 PDT 2011


Author: kremenek
Date: Tue Nov  1 13:08:35 2011
New Revision: 143470

URL: http://llvm.org/viewvc/llvm-project?rev=143470&view=rev
Log:
Downgrade err_iboutlet_object_type to a warning.  It was breaking a bunch of code.  We will reconsider promoting it back to an error later.

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=143470&r1=143469&r2=143470&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Nov  1 13:08:35 2011
@@ -1695,9 +1695,10 @@
   "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<

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=143470&r1=143469&r2=143470&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Nov  1 13:08:35 2011
@@ -760,14 +760,14 @@
   // 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;
     }

Modified: cfe/trunk/test/SemaObjC/iboutletcollection-attr.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/iboutletcollection-attr.m?rev=143470&r1=143469&r2=143470&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/iboutletcollection-attr.m (original)
+++ cfe/trunk/test/SemaObjC/iboutletcollection-attr.m Tue Nov  1 13:08:35 2011
@@ -21,14 +21,14 @@
     __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}}
 
- at property __attribute__((iboutletcollection(BAD))) int prop3; // expected-error {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
+ at property __attribute__((iboutletcollection(BAD))) int prop3; // expected-warning {{property with 'iboutletcollection' attribute must be an object type (invalid 'int')}}
 @end
 
 // rdar://10296078





More information about the cfe-commits mailing list