summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/uninit-variables.c
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2011-03-31 22:32:41 +0000
committerTed Kremenek <kremenek@apple.com>2011-03-31 22:32:41 +0000
commit77361761fbcf92fa5138a54b8425e76e76a852a1 (patch)
treef9db5205256a80c56347caa7e5a89ec660f0a94d /clang/test/Sema/uninit-variables.c
parent0888bcf542411eb84d198ac549cfe14cc1a64a79 (diff)
downloadbcm5719-llvm-77361761fbcf92fa5138a54b8425e76e76a852a1.tar.gz
bcm5719-llvm-77361761fbcf92fa5138a54b8425e76e76a852a1.zip
-Wuninitialized should not warn about variables captured by blocks as byref.
Note this can potentially be enhanced to detect if the __block variable is actually written by the block, or only when the block "escapes" or is actually used, but that requires more analysis than it is probably worth for this simple check. llvm-svn: 128681
Diffstat (limited to 'clang/test/Sema/uninit-variables.c')
-rw-r--r--clang/test/Sema/uninit-variables.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/uninit-variables.c b/clang/test/Sema/uninit-variables.c
index 85e6394edac..17bd07f3e55 100644
--- a/clang/test/Sema/uninit-variables.c
+++ b/clang/test/Sema/uninit-variables.c
@@ -328,3 +328,12 @@ void test50()
char c[1 ? : 2]; // no-warning
}
+int test51(void)
+{
+ __block int a;
+ ^(void) {
+ a = 42;
+ }();
+ return a; // no-warning
+}
+
OpenPOWER on IntegriCloud