diff options
Diffstat (limited to 'clang/lib/Sema/SemaStmt.cpp')
-rw-r--r-- | clang/lib/Sema/SemaStmt.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp index ec11daddf84..cdcbaeae04d 100644 --- a/clang/lib/Sema/SemaStmt.cpp +++ b/clang/lib/Sema/SemaStmt.cpp @@ -2417,6 +2417,9 @@ Sema::ActOnBreakStmt(SourceLocation BreakLoc, Scope *CurScope) { // C99 6.8.6.3p1: A break shall appear only in or as a switch/loop body. return StmtError(Diag(BreakLoc, diag::err_break_not_in_loop_or_switch)); } + if (S->isOpenMPLoopScope()) + return StmtError(Diag(BreakLoc, diag::err_omp_loop_cannot_use_stmt) + << "break"); return new (Context) BreakStmt(BreakLoc); } @@ -3188,6 +3191,9 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock, !getSourceManager().isInSystemHeader(TryLoc)) Diag(TryLoc, diag::err_exceptions_disabled) << "try"; + if (getCurScope() && getCurScope()->isOpenMPSimdDirectiveScope()) + Diag(TryLoc, diag::err_omp_simd_region_cannot_use_stmt) << "try"; + const unsigned NumHandlers = Handlers.size(); assert(NumHandlers > 0 && "The parser shouldn't call this if there are no handlers."); |