[flang-commits] [flang] [Flang][OpenMP] DEFAULT(NONE) error checking on implicit references (PR #182214)

Leandro Lupori via flang-commits flang-commits at lists.llvm.org
Thu Feb 19 10:22:27 PST 2026


================
@@ -2922,6 +2923,25 @@ void OmpAttributeVisitor::CreateImplicitSymbols(const Symbol *symbol) {
     //      Ideally, lowering should be changed and all implicit symbols
     //      should be marked with OmpImplicit.
 
+    if (dirContext.defaultDSA == Symbol::Flag::OmpNone) {
----------------
luporl wrote:

This doesn't work when the DSA is specified by a clause in a nested construct. Example:
```
!$omp parallel default(none)
!$omp task shared(a)
a = 1
!$omp end task
!$omp end parallel
```

At least gfortran and ifx support this.

You will probably need an additional variable to keep track of the default DSA and check if the symbol in the current scope being processed (`scope`) has a predetermined/explicit flag set.

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


More information about the flang-commits mailing list