diff options
author | Mike Stump <mrs@apple.com> | 2009-04-21 22:51:42 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-04-21 22:51:42 +0000 |
commit | 25efa107ae8381458ffa464c5fc7d21135bbe52d (patch) | |
tree | 2ee43ba1a3a40a8db600b7cdf736c7c0cabca231 /test/Sema/block-return.c | |
parent | c474152689a79760a38d349c665ab05a9a8d37bf (diff) |
Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone. Radar 6812711
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69745 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/block-return.c')
-rw-r--r-- | test/Sema/block-return.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c index 3eee002b60..e6101d176f 100644 --- a/test/Sema/block-return.c +++ b/test/Sema/block-return.c @@ -4,7 +4,7 @@ typedef void (^CL)(void); CL foo() { short y; - short (^add1)(void) = ^{ return y+1; }; // expected-warning {{incompatible block pointer types initializing 'int (^)(void)', expected 'short (^)(void)'}} + short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(void)', expected 'short (^)(void)'}} CL X = ^{ if (2) @@ -26,7 +26,7 @@ CL foo() { return (char*)0; }; - double (^A)(void) = ^ { // expected-warning {{incompatible block pointer types initializing 'float (^)(void)', expected 'double (^)(void)'}} + double (^A)(void) = ^ { // expected-error {{incompatible block pointer types initializing 'float (^)(void)', expected 'double (^)(void)'}} if (1) return (float)1.0; else @@ -41,7 +41,7 @@ CL foo() { return 2; // expected-warning {{incompatible integer to pointer conversion returning 'int', expected 'char *'}} }; - return ^{ return 1; }; // expected-warning {{incompatible block pointer types returning 'int (^)(void)', expected 'CL'}} + return ^{ return 1; }; // expected-error {{incompatible block pointer types returning 'int (^)(void)', expected 'CL'}} } typedef int (^CL2)(void); @@ -77,7 +77,7 @@ static int funk(char *s) { return 0; } void foo4() { - int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-warning {{incompatible block pointer types initializing 'int (^)(char *)', expected 'int (^)(char const *)'}} + int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char *)', expected 'int (^)(char const *)'}} int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (char *)', expected 'int (*)(char const *)'}} int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \ |