diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-07-30 08:57:03 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-07-30 08:57:03 +0000 |
| commit | 5ff4e98c61257844aeaef539483842264ee3e974 (patch) | |
| tree | 0c52bc671264c20a8bc3ff5c6e34cb1c544c8df2 /clang/test | |
| parent | b58053bb41bb21901314ce91d7d7bd6acbe75b0f (diff) | |
| download | bcm5719-llvm-5ff4e98c61257844aeaef539483842264ee3e974.tar.gz bcm5719-llvm-5ff4e98c61257844aeaef539483842264ee3e974.zip | |
Introduce a Fix-It for the "missing sentinel" warning, adding an
appropriate sentinel at the end of the argument list. Also, put the
sentinel warnings under -Wsentinel. Fixes <rdar://problem/8764236>.
llvm-svn: 136566
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/FixIt/fixit-objc.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/FixIt/fixit-objc.m b/clang/test/FixIt/fixit-objc.m index 2e8bfaea6aa..df591c79229 100644 --- a/clang/test/FixIt/fixit-objc.m +++ b/clang/test/FixIt/fixit-objc.m @@ -53,3 +53,17 @@ int f0(Radar7861841 *a) { return a.x; } // expected-error {{property 'x' not fou int f1(Radar7861841 *a) { return a->y; } // expected-error {{property 'y' found on object of type 'Radar7861841 *'; did you mean to access it with the "." operator?}} + +#define nil ((void*)0) +#define NULL ((void*)0) + +void sentinel(int x, ...) __attribute__((sentinel)); // expected-note{{function has been explicitly marked sentinel here}} + +@interface Sentinel +- (void)sentinel:(int)x, ... __attribute__((sentinel)); // expected-note{{method has been explicitly marked sentinel here}} +@end + +void sentinel_test(Sentinel *a) { + sentinel(1, 2, 3); // expected-warning{{missing sentinel in function call}} + [a sentinel:1, 2, 3]; // expected-warning{{missing sentinel in method dispatch}} +} |

