diff options
author | Mike Stump <mrs@apple.com> | 2009-10-27 01:59:05 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-10-27 01:59:05 +0000 |
commit | 1d7e767dc8700724b7534a8640596c6a13baf3a7 (patch) | |
tree | 6216c7e365d23022edce9da7c96c5dccb0ce22d5 /test/SemaObjC | |
parent | 848b9b6227e8319efabc9d65aa6ca58c24b85f8b (diff) |
Refine noreturn handling. Fixes -Wmissing-noreturn so that it doesn't
complain that functions that have a return statement should be
declared noreturn. Fixed PR5286.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjC')
-rw-r--r-- | test/SemaObjC/return.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/SemaObjC/return.m b/test/SemaObjC/return.m index 9acf470799..ff64994794 100644 --- a/test/SemaObjC/return.m +++ b/test/SemaObjC/return.m @@ -1,6 +1,22 @@ -// RUN: clang-cc %s -fsyntax-only -verify +// RUN: clang-cc %s -fsyntax-only -verify -Wmissing-noreturn int test1() { id a; @throw a; } + +// PR5286 +void test2(int a) { + while (1) { + if (a) + return; + } +} + +// PR5286 +void test3(int a) { // expected-warning {{function could be attribute 'noreturn'}} + while (1) { + if (a) + @throw (id)0; + } +} |