diff options
| author | John McCall <rjmccall@apple.com> | 2011-03-02 12:15:05 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2011-03-02 12:15:05 +0000 |
| commit | 80ee5963fde83250a863785135bb7dbc7d45d8ef (patch) | |
| tree | 706300ea28b57e425bedfcadbe17c208c7099a58 /clang/test/SemaObjC | |
| parent | 86bc21ffcf1d4875818c9631bbd95152780655a9 (diff) | |
| download | bcm5719-llvm-80ee5963fde83250a863785135bb7dbc7d45d8ef.tar.gz bcm5719-llvm-80ee5963fde83250a863785135bb7dbc7d45d8ef.zip | |
Pretty up the wrong-number-of-arguments-for-attribute diagnostic by
using a custom plural form. Split out the range diagnostics as their
own message.
llvm-svn: 126840
Diffstat (limited to 'clang/test/SemaObjC')
| -rw-r--r-- | clang/test/SemaObjC/attr-objc-gc.m | 2 | ||||
| -rw-r--r-- | clang/test/SemaObjC/format-arg-attribute.m | 8 | ||||
| -rw-r--r-- | clang/test/SemaObjC/iboutletcollection-attr.m | 4 | ||||
| -rw-r--r-- | clang/test/SemaObjC/method-sentinel-attr.m | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/clang/test/SemaObjC/attr-objc-gc.m b/clang/test/SemaObjC/attr-objc-gc.m index 47da653afe6..fd818557f5e 100644 --- a/clang/test/SemaObjC/attr-objc-gc.m +++ b/clang/test/SemaObjC/attr-objc-gc.m @@ -4,5 +4,5 @@ static id __attribute((objc_gc(strong))) b; static id __attribute((objc_gc())) c; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}} static id __attribute((objc_gc(123))) d; // expected-error{{'objc_gc' attribute requires parameter 1 to be a string}} -static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute requires 1 argument(s)}} +static id __attribute((objc_gc(foo, 456))) e; // expected-error{{attribute takes one argument}} static id __attribute((objc_gc(hello))) f; // expected-warning{{'objc_gc' attribute argument not supported: 'hello'}} diff --git a/clang/test/SemaObjC/format-arg-attribute.m b/clang/test/SemaObjC/format-arg-attribute.m index 98dff3aa7a7..6edb8fd99b3 100644 --- a/clang/test/SemaObjC/format-arg-attribute.m +++ b/clang/test/SemaObjC/format-arg-attribute.m @@ -5,16 +5,16 @@ extern NSString *fa2 (const NSString *) __attribute__((format_arg(1))); extern NSString *fa3 (NSString *) __attribute__((format_arg(1))); -extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{attribute requires 1 argument(s)}} -extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{attribute requires 1 argument(s)}} -extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{attribute requires 1 argument(s)}} +extern void fc1 (const NSString *) __attribute__((format_arg)); // expected-error {{attribute takes one argument}} +extern void fc2 (const NSString *) __attribute__((format_arg())); // expected-error {{attribute takes one argument}} +extern void fc3 (const NSString *) __attribute__((format_arg(1, 2))); // expected-error {{attribute takes one argument}} struct s1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}} union u1 { int i; } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}} enum e1 { E1V0 } __attribute__((format_arg(1))); // expected-warning {{'format_arg' attribute only applies to functions}} extern NSString *ff3 (const NSString *) __attribute__((format_arg(3-2))); -extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{attribute requires 1 argument(s)}} +extern NSString *ff4 (const NSString *) __attribute__((format_arg(foo))); // expected-error {{attribute takes one argument}} /* format_arg formats must take and return a string. */ extern NSString *fi0 (int) __attribute__((format_arg(1))); // expected-error {{format argument not a string type}} diff --git a/clang/test/SemaObjC/iboutletcollection-attr.m b/clang/test/SemaObjC/iboutletcollection-attr.m index 217daa7c3b5..5c82c8308a4 100644 --- a/clang/test/SemaObjC/iboutletcollection-attr.m +++ b/clang/test/SemaObjC/iboutletcollection-attr.m @@ -16,13 +16,13 @@ typedef void *PV; @interface BAD { - __attribute__((iboutletcollection(I, 1))) id ivar1; // expected-error {{attribute requires 1 argument(s)}} + __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 have object type (invalid 'void *')}} __attribute__((iboutletcollection(int))) id ivar5; // expected-error {{type argument of iboutletcollection attribute cannot be a builtin type}} } -@property (nonatomic, retain) __attribute__((iboutletcollection(I,2,3))) id prop1; // expected-error {{attribute requires 1 argument(s)}} +@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 have object type (invalid 'int')}} diff --git a/clang/test/SemaObjC/method-sentinel-attr.m b/clang/test/SemaObjC/method-sentinel-attr.m index 5375408a2b6..274e9366065 100644 --- a/clang/test/SemaObjC/method-sentinel-attr.m +++ b/clang/test/SemaObjC/method-sentinel-attr.m @@ -13,7 +13,7 @@ - (void) foo8 : (int)x, ... __attribute__ ((__sentinel__("a"))); // expected-error {{'sentinel' attribute requires parameter 1 to be an integer constant}} - (void) foo9 : (int)x, ... __attribute__ ((__sentinel__(-1))); // expected-error {{'sentinel' parameter 1 less than zero}} - (void) foo10 : (int)x, ... __attribute__ ((__sentinel__(1,1))); -- (void) foo11 : (int)x, ... __attribute__ ((__sentinel__(1,1,3))); // expected-error {{attribute requires 0, 1 or 2 argument(s)}} +- (void) foo11 : (int)x, ... __attribute__ ((__sentinel__(1,1,3))); // expected-error {{attribute takes no more than 2 arguments}} - (void) foo12 : (int)x, ... ATTR; // expected-note {{method has been explicitly marked sentinel here}} // rdar://7975788 |

