diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-01-02 22:45:33 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-01-02 22:45:33 +0000 |
commit | 34b3475cd318ee3193aea210ad4d88a211106fb8 (patch) | |
tree | f9da2fca0e32505ae3469e24224b25a7402385f8 | |
parent | 5b3105d2cb1931fc5a271dc7f59c5adb4e58ca01 (diff) | |
download | bcm5719-llvm-34b3475cd318ee3193aea210ad4d88a211106fb8.tar.gz bcm5719-llvm-34b3475cd318ee3193aea210ad4d88a211106fb8.zip |
Reworded the NSObject attribute diagnostics to be more consistent with other attribute diagnostics. Also updated the associated test case.
llvm-svn: 198368
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 6 | ||||
-rw-r--r-- | clang/test/SemaObjC/nsobject-attribute.m | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index c689e0d6aca..1f0a240fe0a 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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">, diff --git a/clang/test/SemaObjC/nsobject-attribute.m b/clang/test/SemaObjC/nsobject-attribute.m index ead222c3310..6bd2d5dabc4 100644 --- a/clang/test/SemaObjC/nsobject-attribute.m +++ b/clang/test/SemaObjC/nsobject-attribute.m @@ -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 |