<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/110442>110442</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [Flang][OpenMP] OpenMP directive DEFAULT (NONE) is set, but a compilation-time error occurs indicating that the variable does not specify data-sharing attribute.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang:openmp
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 20.0.0(2603c8b23be06116bc61bda36fae05b81d906c3f)/AArch64
```

When building [CP2K](https://www.cp2k.org/), the following error is detected. 
`OpenMP` directive `DEFAULT (NONE)` is set, but a compilation-time error occurs indicating that the variable does not specify `data-sharing` attribute.

The following are a self-made reproducer, Flang-new compilation result.

z1.f90:
```fortran
subroutine sub( aaa)
 real,dimension(*),intent(in)::aaa
  integer::ip
  real::ccc
!$omp parallel do private(ip,ccc) default(none)
  do ip = 1, 10
     ccc= aaa(ip)
  end do
end subroutine sub

program main
 real::arg(10)
  arg=1.0
  print *,'pass'
end program main
```

```
$ flang-new -fopenmp z1.f90
error: Semantic errors in z1.f90
./z1.f90:7:11: error: The DEFAULT(NONE) clause requires that 'aaa' must be listed in a data-sharing attribute clause
       ccc= aaa(ip)
            ^^^
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VMGS4jYQ_Rpx6cIltY2xDxyYYbgk2d2qbJKzLLVBG1lyJHmmNl-fks0AMzuV21IuMG33e63X3U_GaE6OaMc2D2xzWMkpnX3Y-bPz6_7bqvP6-47V_HLxA-P7PylE4x34Hnor3Wnt6AVYuQfkBS84wwZrXqqmw7IjXgtRd6oWnZZl3Uvim64RuuW1KnuGLcPjfh_Uua4W8Hdcy_dfZ3LQTcZq407ANg-PX_AXtjkwbM4pjZGVe4ZHhseXl5d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