mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 17:43:57 +00:00
[AST][RecoveryExpr] Fix an assertion crash on openMP.
Summary: With recovery expr, it is possible that we have a value-dependent expr within non-dependent context. Reviewers: sammccall, jdoerfert Subscribers: yaxunl, guansong, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80200
This commit is contained in:
parent
e86f3075f8
commit
23954318f4
@ -6896,8 +6896,8 @@ bool OpenMPIterationSpaceChecker::checkAndSetInc(Expr *S) {
|
||||
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,
|
||||
|
5
clang/test/OpenMP/recovery-crash.cpp
Normal file
5
clang/test/OpenMP/recovery-crash.cpp
Normal file
@ -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'}}
|
||||
}
|
Loading…
Reference in New Issue
Block a user