<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/107495>107495</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang][OpenMP] Assertion `parallelDir || taskGenDir || teamsDir' failed.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
With assertion-enabled flang-new, the following program causes an assertion failure.
Reproducer:
```f90
integer :: i, j
!$omp parallel
!$omp do default(private)
do i = 1, 10
j = i
end do
!$omp end do
!$omp end parallel
end
```
Assertion:
```txt
flang-new: /opt/llvm-project/flang/lib/Semantics/resolve-directives.cpp:2155: void Fortran::semantics::OmpAttributeVisitor::CreateImplicitSymbols(const Symbol *, std::optional<Symbol::Flag>): Assertion `parallelDir || taskGenDir || teamsDir' failed.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU01vnDAQ_TXDxdqVbfAuHDiQpVQ9VKkaqT0bPLBODLZss2n-fQVsPrRRb5UQ0jzPPHvem5Eh6GFCLEHcgagTOcez9eXTTnpvn0PSWvVS_tbxTGQI6KO20w4n2RpUpDdyGnYTPgM_kXhG0ltj7LOeBuK8HbwcSSfngIHI6b2c9FKb2eMeaA202v4_0Xmr5g49pFcIDnT7-oJuiJ4iDujJkpJWRC_XPn5kAc6AZ3Z0xEkvjUFziytLFPZyNhF47ry-yIjAiy1NWaIJpDVhCzO73koIeVxRvcU4KaLsLfG_0ZunvHLcNPnxtHqV6rMW8U_ckHft04oAb6yLwBtjLuPOefuI3RKuSQusW-DNA45yiroLwBuPwZoL7pT22EV9wbDvnIO04kyIhfJitSKN9dHLadM7vJWv4f3oqhi9bueIv3TQ0frt4ORRRvw2OqM7HR9extaaADzv7BQi2WICvFo0DlFtRdYt_UoD6WnL2ODGyAHSL4tDaUXedCFwoK-y1toTOJ7geCJRhqevOH1EUI6h1h74cR07VPsbQRNVpqpIC5lgyY5ciDxjLE_OpcQ076jM2j4TrGPtkWHX9gdOmaAUO5XoklOe0YIeKBWC5fv-gAzzQ5GJvuBM5pBRHKU2-8WVvfVDokOYsWT0mBUiMbJFE9a94_zqFF9W0Jerje08BMio0SGGd4qoo1mXtVkrRA3i7t7h9P0HiPr_KJTM3pTnGN3qNG-AN4OO57ndd3a8DtnnWVt7W0br2t6l5H8DAAD__-B7U7w">