Skip to content

Commit 106d2bf

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

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
@@ -3077,6 +3077,15 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Linear &x) {
30773077
}
30783078
}
30793079

3080+
// OpenMP 5.2: Ordered clause restriction
3081+
if (const auto *clause{
3082+
FindClause(GetContext(), llvm::omp::Clause::OMPC_ordered)}) {
3083+
const auto &orderedClause{std::get<parser::OmpClause::Ordered>(clause->u)};
3084+
if (orderedClause.v) {
3085+
return;
3086+
}
3087+
}
3088+
30803089
auto checkForValidLinearClause = [&](const parser::Name &name, bool is_ref) {
30813090
parser::CharBlock source{GetContext().clauseSource};
30823091
std::string listItemName{name.ToString()};

0 commit comments

Comments
 (0)