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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Assertion failure in incorrect use of default clause
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          NimishMishra
      </td>
    </tr>
</table>

<pre>
    The following reproducer uses default clause on a disallowed directive

```
program main
  integer, dimension(100) :: a
 integer :: i
  !$omp do ordered default(private)
  do i = 2, 10
 !$omp ordered
    a(i) = a(i-1) + 1
    !$omp end ordered
  end do
  !$omp end do
end program main
```

LLVM Flang crashes with the following assertion failure: `parallelDir || taskGenDir || llvm::omp::allTeamsSet.test(dirContext.directive)`

gfortran, on the other hand, exits with a semantic error.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkU8GOqzgQ_BpzaU1kDIRw4JCXKHuZ2cuO9t7gBnrX2Mg2mdm_XxGIkpeRIscuykV1NY0hcG-JalH8Ekr9ySOH4YPD4FEoJYpzgnMcnK-fnySN0__VnwNB54xxX2x78DR5p-eWPMyBAmjqcDYRWoNzIHAWEDQHXPikQbOnNvKVhDwLedzWvdx-t-PkXe9xhBHZrggA20g9eaFOoHkkG9hZoQ6plEJVILKjyI6AG3sj32G-iwiVCpW7cQLtwHlNfnG0GhbqMHm-YiShqvsF7YBBZGdQy4vTzd-TziZy5wOgUAdeLZ3Xw1t6O6pfkD5oDwWy-lVlgbT7afoZX_Y_c3oJcl3f3__-gItB20PrMQwU4IvjAPG3PmII5CM7Cx2ymT0tyYm9nNCjMWTO7EGUJ1GeIGL49w-yT4gx13EN243TukFjPgnH8BfFXaSw5KvZn5yN9B13j89AVS92-8756NEuiTt7c-niQB4GtHoB6ZvjVgJCoBFt5BbIe-d3z0KJrjNdZRUmVKdlui8PeZWWyVA3Tan21R7LRnYkG-ryShUVkdJVmrdtnnCtpMploUqZ52lR7lTRKZnJKu8KPDRpKnJJI7LZLYXvnO8TDmGmusryrEwMNmTCNlndEvw2Ur5e-G_N3AeRS8MhhodC5Ghu47jeKM5wfG0JsAW2rfNLeHAbr-5l4JLZm3qIcQpLG9RFqEvPcZibXetGoS63Tq1_b5N3_1Abhbrc3AehLmsB11r9HwAA___QMEPP">