Issue 143425
Summary [flang] Implicit ASYNCHRONOUS attribute constraint is not diagnosed.
Labels flang:frontend
Assignees
Reporter DanielCChen
    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=""
 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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to