summaryrefslogtreecommitdiffstats
path: root/test/Sema
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-06-02 01:07:08 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-06-02 01:07:08 +0000
commitdc6683f9e015f6b70cfe34ba77ced9464f293c1d (patch)
tree516131088a06c73cee3529278a9d5b1616dfe351 /test/Sema
parentd78ae5429a1a94a37e8de6c5580e5462873fb92b (diff)
[Sema] Improve -Wstrict-prototypes diagnostic message for blocks.
Print "this block declaration is not a prototype" for non-prototype declarations of blocks instead of "this function declaration ...". rdar://problem/32461723 Differential Revision: https://reviews.llvm.org/D33739 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/warn-strict-prototypes.m11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/Sema/warn-strict-prototypes.m b/test/Sema/warn-strict-prototypes.m
index 4567dab019..66d574f75f 100644
--- a/test/Sema/warn-strict-prototypes.m
+++ b/test/Sema/warn-strict-prototypes.m
@@ -2,16 +2,16 @@
@interface Foo
-@property (nonatomic, copy) void (^noProtoBlock)(); // expected-warning {{this function declaration is not a prototype}}
+@property (nonatomic, copy) void (^noProtoBlock)(); // expected-warning {{this block declaration is not a prototype}}
@property (nonatomic, copy) void (^block)(void); // no warning
-- doStuff:(void (^)()) completionHandler; // expected-warning {{this function declaration is not a prototype}}
+- doStuff:(void (^)()) completionHandler; // expected-warning {{this block declaration is not a prototype}}
- doOtherStuff:(void (^)(void)) completionHandler; // no warning
@end
void foo() {
- void (^block)() = // expected-warning {{this function declaration is not a prototype}}
+ void (^block)() = // expected-warning {{this block declaration is not a prototype}}
^void(int arg) { // no warning
};
void (^block2)(void) = ^void() { // no warning
@@ -19,3 +19,8 @@ void foo() {
void (^block3)(void) = ^ { // no warning
};
}
+
+void (*(^(*(^block4)()) // expected-warning {{this block declaration is not a prototype}}
+ ()) // expected-warning {{this function declaration is not a prototype}}
+ ()) // expected-warning {{this block declaration is not a prototype}}
+ (); // expected-warning {{this function declaration is not a prototype}}