r198368 - Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.

Aaron Ballman aaron at aaronballman.com
Thu Jan 2 14:45:33 PST 2014


Author: aaronballman
Date: Thu Jan  2 16:45:33 2014
New Revision: 198368

URL: http://llvm.org/viewvc/llvm-project?rev=198368&view=rev
Log:
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/test/SemaObjC/nsobject-attribute.m

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=198368&r1=198367&r2=198368&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Jan  2 16:45:33 2014
@@ -1795,7 +1795,7 @@ def warn_auto_var_is_id : Warning<
 
 // Attributes
 def err_nsobject_attribute : Error<
-  "__attribute ((NSObject)) is for pointer types only">;
+  "'NSObject' attribute is for pointer types only">;
 def err_attribute_can_be_applied_only_to_symbol_declaration : Error<
   "%0 attribute can be applied only to symbol declaration">;
 def err_attributes_are_not_compatible : Error<
@@ -2001,8 +2001,8 @@ def warn_gc_attribute_weak_on_local : Wa
   "Objective-C GC does not allow weak variables on the stack">,
   InGroup<IgnoredAttributes>;
 def warn_nsobject_attribute : Warning<
-  "__attribute ((NSObject)) may be put on a typedef only, "
-  "attribute is ignored">, InGroup<NSobjectAttribute>;
+  "'NSObject' attribute may be put on a typedef only; attribute is ignored">,
+  InGroup<NSobjectAttribute>;
 def warn_attribute_weak_on_local : Warning<
   "__weak attribute cannot be specified on an automatic variable when ARC "
   "is not enabled">,

Modified: cfe/trunk/test/SemaObjC/nsobject-attribute.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/nsobject-attribute.m?rev=198368&r1=198367&r2=198368&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/nsobject-attribute.m (original)
+++ cfe/trunk/test/SemaObjC/nsobject-attribute.m Thu Jan  2 16:45:33 2014
@@ -6,7 +6,7 @@ typedef struct CGColor * __attribute__((
 static int count;
 static CGColorRef tmp = 0;
 
-typedef struct S1  __attribute__ ((NSObject)) CGColorRef1; // expected-error {{__attribute ((NSObject)) is for pointer types only}}
+typedef struct S1  __attribute__ ((NSObject)) CGColorRef1; // expected-error {{'NSObject' attribute is for pointer types only}}
 typedef void *  __attribute__ ((NSObject)) CGColorRef2; // no-warning
 typedef void * CFTypeRef;
 
@@ -48,18 +48,18 @@ int main(int argc, char *argv[]) {
 // rdar://10453342
 @interface I
 {
-   __attribute__((NSObject)) void * color; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
+   __attribute__((NSObject)) void * color; // expected-warning {{'NSObject' attribute may be put on a typedef only; attribute is ignored}}
 }
   // <rdar://problem/10930507>
 @property (nonatomic, retain) __attribute__((NSObject)) CGColorRefNoNSObject color; // // no-warning
 @end
 void test_10453342() {
-    char* __attribute__((NSObject)) string2 = 0; // expected-warning {{__attribute ((NSObject)) may be put on a typedef only, attribute is ignored}}
+    char* __attribute__((NSObject)) string2 = 0; // expected-warning {{'NSObject' attribute may be put on a typedef only; attribute is ignored}}
 }
 
 // rdar://11569860
 @interface A { int i; }
- at property(retain) __attribute__((NSObject)) int i; // expected-error {{__attribute ((NSObject)) is for pointer types only}} \
+ at property(retain) __attribute__((NSObject)) int i; // expected-error {{'NSObject' attribute is for pointer types only}} \
   						   // expected-error {{property with 'retain (or strong)' attribute must be of object type}}
 @end
 





More information about the cfe-commits mailing list