Allow void blocks to return witn a void expression in
c-mode to match behavior with void functions in c. Issue
warning with -pedantic. // rdar://11069896
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153200 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c
index e8c6516..67bc5c7 100644
--- a/test/Sema/block-return.c
+++ b/test/Sema/block-return.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only %s -verify -fblocks
+// RUN: %clang_cc1 -pedantic -fsyntax-only %s -verify -fblocks
typedef void (^CL)(void);
@@ -130,4 +130,7 @@
int (^NN) (void) = ^{ return cint; };
}
-
+// rdar://11069896
+void (^blk)(void) = ^{
+ return (void)0; // expected-warning {{void block should not return void expression}}
+};