summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/block-return.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-09 17:53:29 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-09 17:53:29 +0000
commitb10646d4ce23bbed949861b3fcb71f1ff1b91c76 (patch)
tree0205c29f30f9661c355ced54f6b027cf822ec903 /clang/test/Sema/block-return.c
parentfb8b27d5303819ac6df89c1df07266151d9683bc (diff)
downloadbcm5719-llvm-b10646d4ce23bbed949861b3fcb71f1ff1b91c76.tar.gz
bcm5719-llvm-b10646d4ce23bbed949861b3fcb71f1ff1b91c76.zip
Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...", which reads better. Thanks to John for the improved wording. llvm-svn: 100873
Diffstat (limited to 'clang/test/Sema/block-return.c')
-rw-r--r--clang/test/Sema/block-return.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/test/Sema/block-return.c b/clang/test/Sema/block-return.c
index f4eff65ed48..10b3b8480cc 100644
--- a/clang/test/Sema/block-return.c
+++ b/clang/test/Sema/block-return.c
@@ -4,7 +4,7 @@ typedef void (^CL)(void);
CL foo() {
short y;
- short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'short (^)(void)' from an expression of type 'int (^)(void)'}}
+ short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'short (^)(void)' with an expression of type 'int (^)(void)'}}
CL X = ^{
if (2)
@@ -26,7 +26,7 @@ CL foo() {
return (char*)0;
};
- double (^A)(void) = ^ { // expected-error {{incompatible block pointer types initializing 'double (^)(void)' from an expression of type 'float (^)(void)'}}
+ double (^A)(void) = ^ { // expected-error {{incompatible block pointer types initializing 'double (^)(void)' with an expression of type 'float (^)(void)'}}
if (1)
return (float)1.0;
else
@@ -78,8 +78,8 @@ static int funk(char *s) {
}
void next();
void foo4() {
- int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char const *)' from an expression of type 'int (^)(char *)'}}
- int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(char const *)' from an expression of type 'int (char *)'}}
+ int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char const *)' with an expression of type 'int (^)(char *)'}}
+ int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(char const *)' with an expression of type 'int (char *)'}}
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 *, ...)'}} \
// expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
@@ -109,7 +109,7 @@ void foo6() {
void foo7()
{
- const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' from an expression of type 'int (^)(void)'}}
+ const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' with an expression of type 'int (^)(void)'}}
const int (^CC) (void) = ^const int{ const int i = 1; return i; }; // OK
int i;
OpenPOWER on IntegriCloud