[clang] 9b3bf72 - [OPENMP50]Allow use of array shaping expression in a list.
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 31 14:18:27 PDT 2020
Author: Alexey Bataev
Date: 2020-03-31T17:15:31-04:00
New Revision: 9b3bf72a0d7918601e8005554592fcb4949a822e
URL: https://github.com/llvm/llvm-project/commit/9b3bf72a0d7918601e8005554592fcb4949a822e
DIFF: https://github.com/llvm/llvm-project/commit/9b3bf72a0d7918601e8005554592fcb4949a822e.diff
LOG: [OPENMP50]Allow use of array shaping expression in a list.
Need to allow arrayshaping expression in a list of expressions, so use
ParseAssignmentExpression() when try to parse the base of the shaping
operation.
Added:
Modified:
clang/lib/Parse/ParseExpr.cpp
clang/test/OpenMP/task_ast_print.cpp
Removed:
################################################################################
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 9a0f94ae7be5..fc07cfe5ad03 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -3001,7 +3001,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
// Match the ')'.
T.consumeClose();
RParenLoc = T.getCloseLocation();
- Result = Actions.CorrectDelayedTyposInExpr(ParseExpression());
+ Result = Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
if (ErrorFound) {
Result = ExprError();
} else if (!Result.isInvalid()) {
diff --git a/clang/test/OpenMP/task_ast_print.cpp b/clang/test/OpenMP/task_ast_print.cpp
index 0f11b390f7fa..1da6c5045934 100644
--- a/clang/test/OpenMP/task_ast_print.cpp
+++ b/clang/test/OpenMP/task_ast_print.cpp
@@ -164,8 +164,8 @@ int main(int argc, char **argv) {
#pragma omp threadprivate(a)
Enum ee;
// CHECK: Enum ee;
-#pragma omp task untied mergeable depend(out:argv[:a][1], (arr)[0:],([argc][10])argv) if(task: argc > 0) priority(f) depend(depobj:y)
- // CHECK-NEXT: #pragma omp task untied mergeable depend(out : argv[:a][1],(arr)[0:],([argc][10])argv) if(task: argc > 0) priority(f) depend(depobj : y)
+#pragma omp task untied mergeable depend(out:argv[:a][1], (arr)[0:],([argc][10])argv,b) if(task: argc > 0) priority(f) depend(depobj:y)
+ // CHECK-NEXT: #pragma omp task untied mergeable depend(out : argv[:a][1],(arr)[0:],([argc][10])argv,b) if(task: argc > 0) priority(f) depend(depobj : y)
a = 2;
// CHECK-NEXT: a = 2;
#pragma omp taskgroup task_reduction(min: arr1)
More information about the cfe-commits
mailing list