summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-05-11 07:19:11 +0000
committerJohn McCall <rjmccall@apple.com>2011-05-11 07:19:11 +0000
commitc67067f43e4bf2adf522857d08f6b8cef6866a98 (patch)
tree7f3e683c82e0078267465f90052cae0c2f698989 /clang/test
parentc6587cc550f2252328d7db55fb4d700a4916b671 (diff)
downloadbcm5719-llvm-c67067f43e4bf2adf522857d08f6b8cef6866a98.tar.gz
bcm5719-llvm-c67067f43e4bf2adf522857d08f6b8cef6866a98.zip
Teach CFG building how to deal with CXXMemberCallExprs and BoundMemberTy,
then teach -Wreturn-type to handle the same. Net effect: we now correctly handle noreturn attributes on member calls in the CFG. llvm-svn: 131178
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/attr-noreturn.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/attr-noreturn.cpp b/clang/test/SemaCXX/attr-noreturn.cpp
index b7d39992b8f..eaf0d0c15ff 100644
--- a/clang/test/SemaCXX/attr-noreturn.cpp
+++ b/clang/test/SemaCXX/attr-noreturn.cpp
@@ -1,5 +1,22 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// Reachability tests have to come first because they get suppressed
+// if any errors have occurred.
+namespace test5 {
+ struct A {
+ __attribute__((noreturn)) void fail();
+ void nofail();
+ } a;
+
+ int &test1() {
+ a.nofail();
+ } // expected-warning {{control reaches end of non-void function}}
+
+ int &test2() {
+ a.fail();
+ }
+}
+
// PR5620
void f0() __attribute__((__noreturn__));
void f1(void (*)());
OpenPOWER on IntegriCloud