aboutsummaryrefslogtreecommitdiff
path: root/test/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-03-21 00:10:07 +0000
committerJohn McCall <rjmccall@apple.com>2013-03-21 00:10:07 +0000
commitb9da713efb4277753211590953f433723908aade (patch)
treec5f4fcdca4ff986302d7e505340bce3f67d9d69b /test/Sema
parentb79f589f51da22c13ed5e1d00258236e7e8f555f (diff)
Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type of the same size. rdar://13463504 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/block-return.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c
index 2ea4d813ab..6b4d99830c 100644
--- a/test/Sema/block-return.c
+++ b/test/Sema/block-return.c
@@ -134,3 +134,14 @@ void foo7()
void (^blk)(void) = ^{
return (void)0; // expected-warning {{void block literal should not return void expression}}
};
+
+// rdar://13463504
+enum Test8 { T8_a, T8_b, T8_c };
+void test8(void) {
+ extern void test8_helper(int (^)(int));
+ test8_helper(^(int flag) { if (flag) return T8_a; return T8_b; });
+}
+void test8b(void) {
+ extern void test8_helper2(char (^)(int)); // expected-note {{here}}
+ test8_helper2(^(int flag) { if (flag) return T8_a; return T8_b; }); // expected-error {{passing 'enum Test8 (^)(int)' to parameter of type 'char (^)(int)'}}
+}