diff options
author | Anders Carlsson <andersca@mac.com> | 2010-09-03 00:25:02 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2010-09-03 00:25:02 +0000 |
commit | af7534f08496c118a8575a7adbbd5715a624e4a0 (patch) | |
tree | 6cb4ea7e5f39f15947a09107758f105dcd626af2 /clang/test/Sema/block-return.c | |
parent | 09c8fbe812d9dfde2c6b665ecf5d1f4e87d16c69 (diff) | |
download | bcm5719-llvm-af7534f08496c118a8575a7adbbd5715a624e4a0.tar.gz bcm5719-llvm-af7534f08496c118a8575a7adbbd5715a624e4a0.zip |
Get rid of the "functions declared 'noreturn' should have a 'void' result type" warning.
The rationale behind this is that it is normal for callback functions to have a non-void return type
and it should still be possible to mark them noreturn. (JavaScriptCore is a good example of this).
llvm-svn: 112918
Diffstat (limited to 'clang/test/Sema/block-return.c')
-rw-r--r-- | clang/test/Sema/block-return.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Sema/block-return.c b/clang/test/Sema/block-return.c index d40cef18d21..5a4ec010d3a 100644 --- a/clang/test/Sema/block-return.c +++ b/clang/test/Sema/block-return.c @@ -100,10 +100,10 @@ int (*funcptr3[5])(long); int sz8 = sizeof(^int (*[5])(long) {return funcptr3;}); // expected-error {{block declared as returning an array}} void foo6() { - int (^b)(int) __attribute__((noreturn)); // expected-warning{{blocks declared 'noreturn' should have a 'void' result type}} + int (^b)(int) __attribute__((noreturn)); b = ^ (int i) __attribute__((noreturn)) { return 1; }; // expected-error {{block declared 'noreturn' should not return}} b(1); - int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; // expected-error {{block declared 'noreturn' should not return}} expected-warning{{blocks declared 'noreturn' should have a 'void' result type}} + int (^c)(void) __attribute__((noreturn)) = ^ __attribute__((noreturn)) { return 100; }; // expected-error {{block declared 'noreturn' should not return}} } |