[OPENMP50]Fix capturing of if condition in target parallel for simd
directive.
Fixed capturing of the if condition if no modifer was specified in this
condition. Previously could capture it only in outer region and it could
lead to a compiler crash.
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 4f4c4d2..91d76e6 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -10705,8 +10705,10 @@
switch (DKind) {
case OMPD_target_parallel_for_simd:
if (OpenMPVersion >= 50 &&
- (NameModifier == OMPD_unknown || NameModifier == OMPD_simd))
+ (NameModifier == OMPD_unknown || NameModifier == OMPD_simd)) {
CaptureRegion = OMPD_parallel;
+ break;
+ }
LLVM_FALLTHROUGH;
case OMPD_target_parallel:
case OMPD_target_parallel_for: