summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/return.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2009-04-30 16:01:26 +0000
committerSteve Naroff <snaroff@apple.com>2009-04-30 16:01:26 +0000
commit62e0cb0a22eebb4537a48cbcf457d134d8eec686 (patch)
tree1aea1768809c40356daa0cf1111ef3279dd6ef09 /clang/test/Sema/return.c
parente6141a5d6f6cf4520caffa6f9700b0ec9f34e765 (diff)
downloadbcm5719-llvm-62e0cb0a22eebb4537a48cbcf457d134d8eec686.tar.gz
bcm5719-llvm-62e0cb0a22eebb4537a48cbcf457d134d8eec686.zip
Warn about invalid return statements by default.
This fixes <rdar://problem/6839489> 10A345: Clang does not warm about mismatched returns (void return from a bool function) Will implement -Wreturn-type, -Wno-return-type in another commit. llvm-svn: 70492
Diffstat (limited to 'clang/test/Sema/return.c')
-rw-r--r--clang/test/Sema/return.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Sema/return.c b/clang/test/Sema/return.c
new file mode 100644
index 00000000000..b32b2e9eeb0
--- /dev/null
+++ b/clang/test/Sema/return.c
@@ -0,0 +1,9 @@
+// RUN: clang-cc %s -fsyntax-only -verify
+
+// clang emits the following warning by default.
+// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
+// following warning.
+int t14() {
+ return; // expected-warning {{non-void function 't14' should return a value}}
+}
+
OpenPOWER on IntegriCloud