Skip to content

Commit 96fad74

Browse files
[LLVM-Flang][OpenMP] Skip Linear clause semantic check if ordered clause with (n) is specified
1 parent 8d4e229 commit 96fad74

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,6 +3570,15 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
35703570
}
35713571
}
35723572

3573+
// OpenMP 5.2: Ordered clause restriction
3574+
if (const auto *clause{
3575+
FindClause(GetContext(), llvm::omp::Clause::OMPC_ordered)}) {
3576+
const auto &orderedClause{std::get<parser::OmpClause::Ordered>(clause->u)};
3577+
if (orderedClause.v) {
3578+
return;
3579+
}
3580+
}
3581+
35733582
auto checkForValidLinearClause_01 = [&](const parser::Name &name,
35743583
bool is_ref) {
35753584
std::string listItemName{name.ToString()};

0 commit comments

Comments
 (0)