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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Implicit ASYNCHRONOUS attribute constraint is not diagnosed.
        </td>
    </tr>

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

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

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

<pre>
    Consider the following code:
```

    INTERFACE
        SUBROUTINE ExplicitShapeArray(ioUnit, arrayShapeExplicit)
            integer :: ioUnit
            complex, asynchronous, dimension( 10 ) :: arrayShapeExplicit
        END SUBROUTINE ExplicitShapeArray
    END INTERFACE

    complex, pointer, dimension( : ) :: ptrComplexArray
 complex, target, dimension( 10 ) :: complexArray


    ptrComplexArray => complexArray
    open(1226, asynchronous='yes', action='read',&
 access='stream', form='unformatted')


    do i = 1, 10
 read(1226, asynchronous='yes') complexArray
    end do


    call ExplicitShapeArray(1226, ptrComplexArray)


    close( 1226 )

END


SUBROUTINE ExplicitShapeArray(ioUnit, arrayShapeExplicit)
 integer :: ioUnit
    complex, asynchronous, dimension( 10 ) :: arrayShapeExplicit


END SUBROUTINE ExplicitShapeArray
```

This code violates Constraint C1549
```
C1549 (R1524) If an actual argument is an array pointer that has the ASYNCHRONOUS or VOLATILE
attribute but does not have the CONTIGUOUS attribute, and the corresponding dummy argument
has either the ASYNCHRONOUS or VOLATILE attribute, but does not have the VALUE attribute,
that dummy argument shall be an array pointer, an assumed-shape array without the CONTIGUOUS
attribute, or an assumed-rank entity without the CONTIGUOUS attribute.
```

`ptrComplexArray` is implicitly given the `asynchronous` attribute, so the call to `ExplicitShapeArray` should be diagnosed.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVV1vozgU_TXOi9XIGDDlgQcmH7uRqlRqm5H20cE34F1jR7bpTP79ykCTk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