diff options
author | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 02:47:59 +0000 |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2015-03-09 02:47:59 +0000 |
commit | d64657f2989f0e1e279f1ad8a03f627b4b60f407 (patch) | |
tree | 771755984c567efb57fd15d7c16b463fbd2501e7 /clang/lib/Sema/TreeTransform.h | |
parent | 9af63b22a5e5e3f5dc921dc987ccf96dabb87b43 (diff) | |
download | bcm5719-llvm-d64657f2989f0e1e279f1ad8a03f627b4b60f407.tar.gz bcm5719-llvm-d64657f2989f0e1e279f1ad8a03f627b4b60f407.zip |
Warn when jumping out of a __finally block via continue, break, return, __leave.
Since continue, break, return are much more common than __finally, this tries
to keep the work for continue, break, return O(1). Sema keeps a stack of active
__finally scopes (to do this, ActOnSEHFinally() is split into
ActOnStartSEHFinally() and ActOnFinishSEHFinally()), and the various jump
statements then check if the current __finally scope (if present) is deeper
than then destination scope of the jump.
The same warning for goto statements is still missing.
This is the moral equivalent of MSVC's C4532.
llvm-svn: 231623
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index e1d0d18dde4..351dacd256e 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -1702,7 +1702,7 @@ public: } StmtResult RebuildSEHFinallyStmt(SourceLocation Loc, Stmt *Block) { - return getSema().ActOnSEHFinallyBlock(Loc, Block); + return SEHFinallyStmt::Create(getSema().getASTContext(), Loc, Block); } /// \brief Build a new predefined expression. |