From d64657f2989f0e1e279f1ad8a03f627b4b60f407 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Mon, 9 Mar 2015 02:47:59 +0000 Subject: 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 --- clang/lib/Sema/TreeTransform.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Sema/TreeTransform.h') 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. -- cgit v1.2.3