summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-11 23:34:02 +0000
committerChris Lattner <sabre@nondot.org>2010-07-11 23:34:02 +0000
commit33919e7450530e64804651c25a306cff548b39fb (patch)
tree18ea4a4c52e6aa8d7a8790d5a6aab6a362886e1e /clang/test/Sema
parentb6df00c29a9b4f456487280390f29640c2ef5974 (diff)
downloadbcm5719-llvm-33919e7450530e64804651c25a306cff548b39fb.tar.gz
bcm5719-llvm-33919e7450530e64804651c25a306cff548b39fb.zip
fix PR7280 by making the warning on code like this:
int test1() { return; } default to an error. llvm-svn: 108108
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/function.c4
-rw-r--r--clang/test/Sema/implicit-decl.c1
-rw-r--r--clang/test/Sema/return.c2
3 files changed, 3 insertions, 4 deletions
diff --git a/clang/test/Sema/function.c b/clang/test/Sema/function.c
index 9a83519a90b..b51c137ce7d 100644
--- a/clang/test/Sema/function.c
+++ b/clang/test/Sema/function.c
@@ -34,10 +34,10 @@ void t12(int) {} // expected-error{{parameter name omitted}}
// PR2790
void t13() {
- return 0; // expected-warning {{void function 't13' should not return a value}}
+ return 0; // expected-error {{void function 't13' should not return a value}}
}
int t14() {
- return; // expected-warning {{non-void function 't14' should return a value}}
+ return; // expected-error {{non-void function 't14' should return a value}}
}
// <rdar://problem/6097326>
diff --git a/clang/test/Sema/implicit-decl.c b/clang/test/Sema/implicit-decl.c
index 830cde9b9f9..f4559775366 100644
--- a/clang/test/Sema/implicit-decl.c
+++ b/clang/test/Sema/implicit-decl.c
@@ -10,7 +10,6 @@ void func() {
if (_CFCalendarDecomposeAbsoluteTimeV(compDesc, vector, compCount)) { // expected-note {{previous implicit declaration is here}} \
expected-warning {{implicit declaration of function '_CFCalendarDecomposeAbsoluteTimeV' is invalid in C99}}
}
- return ((void *)0); // expected-warning {{void function 'func' should not return a value}}
}
Boolean _CFCalendarDecomposeAbsoluteTimeV(const char *componentDesc, int32_t **vector, int32_t count) { // expected-error{{conflicting types for '_CFCalendarDecomposeAbsoluteTimeV'}}
return 0;
diff --git a/clang/test/Sema/return.c b/clang/test/Sema/return.c
index 0d46d981bed..2d23e080396 100644
--- a/clang/test/Sema/return.c
+++ b/clang/test/Sema/return.c
@@ -1,4 +1,4 @@
-// RUN: %clang %s -fsyntax-only -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
+// RUN: %clang %s -fsyntax-only -Wreturn-type -Xclang -verify -fblocks -Wno-unreachable-code -Wno-unused-value
// clang emits the following warning by default.
// With GCC, -pedantic, -Wreturn-type or -Wall are required to produce the
OpenPOWER on IntegriCloud