]> granicus.if.org Git - clang/commitdiff
Reworded the NSObject attribute diagnostics to be more consistent with other attribut...
authorAaron Ballman <aaron@aaronballman.com>
Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Thu, 2 Jan 2014 22:45:33 +0000 (22:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198368 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
test/SemaObjC/nsobject-attribute.m

index c689e0d6aca9a20cbab747a774fbe0fef4c5b7ed..1f0a240fe0a9a0465b926b75e456ae68dd909b16 100644 (file)
@@ -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 : Warning<
   "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">,
index ead222c3310b0e624bc4b2ba4f0f37a2a0ee8582..6bd2d5dabc4b9ad0e17d98da258a559049a13ed0 100644 (file)
@@ -6,7 +6,7 @@ typedef struct CGColor * __attribute__((NSObject(12))) Illegal;  // expected-err
 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; }
-@property(retain) __attribute__((NSObject)) int i; // expected-error {{__attribute ((NSObject)) is for pointer types only}} \
+@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