This revision was automatically updated to reflect the committed changes.
Closed by commit rG23954318f49f: [AST][RecoveryExpr] Fix an assertion crash on
openMP. (authored by hokein).
Herald added a subscriber: sstefan1.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80200/new/
https://reviews.llvm.org/D80200
Files:
clang/lib/Sema/SemaOpenMP.cpp
clang/test/OpenMP/recovery-crash.cpp
Index: clang/test/OpenMP/recovery-crash.cpp
===================================================================
--- /dev/null
+++ clang/test/OpenMP/recovery-crash.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -frecovery-ast %s
+
+void foo(int i) {
+#pragma omp target update from(i) device(undef()) // expected-error {{use of
undeclared identifier 'undef'}}
+}
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -6896,8 +6896,8 @@
static ExprResult
tryBuildCapture(Sema &SemaRef, Expr *Capture,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) {
- if (SemaRef.CurContext->isDependentContext())
- return ExprResult(Capture);
+ if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors())
+ return Capture;
if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects))
return SemaRef.PerformImplicitConversion(
Capture->IgnoreImpCasts(), Capture->getType(), Sema::AA_Converting,
Index: clang/test/OpenMP/recovery-crash.cpp
===================================================================
--- /dev/null
+++ clang/test/OpenMP/recovery-crash.cpp
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -frecovery-ast %s
+
+void foo(int i) {
+#pragma omp target update from(i) device(undef()) // expected-error {{use of undeclared identifier 'undef'}}
+}
Index: clang/lib/Sema/SemaOpenMP.cpp
===================================================================
--- clang/lib/Sema/SemaOpenMP.cpp
+++ clang/lib/Sema/SemaOpenMP.cpp
@@ -6896,8 +6896,8 @@
static ExprResult
tryBuildCapture(Sema &SemaRef, Expr *Capture,
llvm::MapVector<const Expr *, DeclRefExpr *> &Captures) {
- if (SemaRef.CurContext->isDependentContext())
- return ExprResult(Capture);
+ if (SemaRef.CurContext->isDependentContext() || Capture->containsErrors())
+ return Capture;
if (Capture->isEvaluatable(SemaRef.Context, Expr::SE_AllowSideEffects))
return SemaRef.PerformImplicitConversion(
Capture->IgnoreImpCasts(), Capture->getType(), Sema::AA_Converting,
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits