diff options
| author | Manuel Klimek <klimek@google.com> | 2014-08-07 17:02:21 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2014-08-07 17:02:21 +0000 |
| commit | cadc603e9154e607fa090b2f07ecc16465d36ebb (patch) | |
| tree | f0851c25003ddb7e3f6e825307e07e5f157812c2 /clang/test | |
| parent | c3494340108a027ca8a7538cca545ce798abe5db (diff) | |
| download | bcm5719-llvm-cadc603e9154e607fa090b2f07ecc16465d36ebb.tar.gz bcm5719-llvm-cadc603e9154e607fa090b2f07ecc16465d36ebb.zip | |
Fix CFG for temporary dtors when the branch taken is known.
Use the parent context when visiting temporaries when we do not insert a
temporary dtor decision branch.
llvm-svn: 215120
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/SemaCXX/return-noreturn.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/return-noreturn.cpp b/clang/test/SemaCXX/return-noreturn.cpp index 519d27cf0b8..3bb395f17d6 100644 --- a/clang/test/SemaCXX/return-noreturn.cpp +++ b/clang/test/SemaCXX/return-noreturn.cpp @@ -183,6 +183,14 @@ int testTernaryConditionalNoreturnFalseBranch(bool value) { value ? Return() : (NoReturn() || NoReturn()); } // expected-warning {{control may reach end of non-void function}} +int testConditionallyExecutedComplexTernaryTrueBranch(bool value) { + value || (true ? NoReturn() : true); +} // expected-warning {{control may reach end of non-void function}} + +int testConditionallyExecutedComplexTernaryFalseBranch(bool value) { + value || (false ? true : NoReturn()); +} // expected-warning {{control may reach end of non-void function}} + int testStaticallyExecutedLogicalOrBranch() { false || NoReturn(); } @@ -199,6 +207,9 @@ int testStaticallySkppedLogicalAndBranch() { false && NoReturn(); } // expected-warning {{control reaches end of non-void function}} +int testConditionallyExecutedComplexLogicalBranch(bool value) { + value || (true && NoReturn()); +} // expected-warning {{control may reach end of non-void function}} #if __cplusplus >= 201103L namespace LambdaVsTemporaryDtor { |

