diff options
author | Anders Carlsson <andersca@mac.com> | 2011-02-19 19:26:44 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2011-02-19 19:26:44 +0000 |
commit | 7f11d9cf5df1f8ce82af46eabc4ec5cec7d580b0 (patch) | |
tree | a870ff25e6a7304d663f1a819110a41bb3e8c769 /lib/Sema/SemaStmt.cpp | |
parent | d9ea180032eda76a46c099a9aab99512447c326d (diff) |
Disallow try/catch/throw when exceptions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126039 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaStmt.cpp')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index ba50824c1b..523fc4a852 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -1741,6 +1741,9 @@ public: StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock, MultiStmtArg RawHandlers) { + if (!getLangOptions().Exceptions) + return Diag(TryLoc, diag::err_exceptions_disabled) << "try"; + unsigned NumHandlers = RawHandlers.size(); assert(NumHandlers > 0 && "The parser shouldn't call this if there are no handlers."); |