[flang-commits] [flang] [flang][OpenMP] Remember decision of allowing past/future clause (PR #227419)

Krzysztof Parzyszek via flang-commits flang-commits at lists.llvm.org
Thu Oct 1 06:32:06 PDT 2026


kparzysz wrote:

> A similar problem still remains for if clause on teams.

Yes. This is because when we detect that a clause is not valid (in this version) on a compound directive, we set the override for every leaf that supports this clause in _some_ version.  Since both TEAMS and SIMD allow IF (albeit in different versions), we mark IF to be allowed on both of them with -fopenmp-version=45. Since IF is allowed on the compound directive in 5.0, we don't set any overrides, and you're seeing the default behavior.  Same in 5.2 where IF is outright allowed on both leafs.

I agree that recommending -fopenmp-version=50 (for the 4.5 case), and then effectively treating it as 5.2 is questionable.  We should only override the clause for leafs in the version that we suggest.

https://github.com/llvm/llvm-project/pull/227419


More information about the flang-commits mailing list