Skip to content

Commit eee003d

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

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
@@ -3013,6 +3013,15 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
30133013
}
30143014
}
30153015

3016+
// OpenMP 5.2: Ordered clause restriction
3017+
if (const auto *clause{
3018+
FindClause(GetContext(), llvm::omp::Clause::OMPC_ordered)}) {
3019+
const auto &orderedClause{std::get<parser::OmpClause::Ordered>(clause->u)};
3020+
if (orderedClause.v) {
3021+
return;
3022+
}
3023+
}
3024+
30163025
auto checkForValidLinearClause = [&](const parser::Name &name, bool is_ref) {
30173026
parser::CharBlock source{GetContext().clauseSource};
30183027
std::string listItemName{name.ToString()};

0 commit comments

Comments
 (0)