summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp5
-rw-r--r--clang/lib/Sema/SemaStmt.cpp5
2 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index b8431ce36ec..fe1676abb93 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -752,10 +752,7 @@ ExprResult Sema::BuildCXXThrow(SourceLocation OpLoc, Expr *Ex,
if (!getLangOpts().CXXExceptions &&
!getSourceManager().isInSystemHeader(OpLoc)) {
// Delay error emission for the OpenMP device code.
- if (LangOpts.OpenMP && LangOpts.OpenMPIsDevice)
- diagIfOpenMPDeviceCode(OpLoc, diag::err_exceptions_disabled) << "throw";
- else
- Diag(OpLoc, diag::err_exceptions_disabled) << "throw";
+ targetDiag(OpLoc, diag::err_exceptions_disabled) << "throw";
}
// Exceptions aren't allowed in CUDA device code.
diff --git a/clang/lib/Sema/SemaStmt.cpp b/clang/lib/Sema/SemaStmt.cpp
index 5f041390909..fb5c2dacc80 100644
--- a/clang/lib/Sema/SemaStmt.cpp
+++ b/clang/lib/Sema/SemaStmt.cpp
@@ -3995,10 +3995,7 @@ StmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock,
if (!getLangOpts().CXXExceptions &&
!getSourceManager().isInSystemHeader(TryLoc)) {
// Delay error emission for the OpenMP device code.
- if (LangOpts.OpenMP && LangOpts.OpenMPIsDevice)
- diagIfOpenMPDeviceCode(TryLoc, diag::err_exceptions_disabled) << "try";
- else
- Diag(TryLoc, diag::err_exceptions_disabled) << "try";
+ targetDiag(TryLoc, diag::err_exceptions_disabled) << "try";
}
// Exceptions aren't allowed in CUDA device code.
OpenPOWER on IntegriCloud