[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
Mon Mar 2 08:54:52 PST 2026


================
@@ -29,8 +29,21 @@ subroutine default_none_seq_loop
   enddo
 end subroutine
 
+! Test that DEFAULT(NONE) error check sees implicit references
+subroutine default_none_nested()
+  integer :: a
+
+  !$omp parallel default(none)
+  !$omp task
+  !ERROR: The DEFAULT(NONE) clause requires that 'a' must be listed in a data-sharing attribute clause
+  a = 1
+  !$omp end task
+  !$omp end parallel
+end subroutine default_none_nested
+
 program mm
   call default_none()
   call default_none_seq_loop()
+  call default_none_nested()
----------------
luporl wrote:

Can you add a test for the following case too?

```
!$omp parallel default(none)
!$omp task private(a)
...
```

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


More information about the flang-commits mailing list