Skip to content

[flang] Implicit ASYNCHRONOUS attribute constraint is not diagnosed. #143425

@DanielCChen

Description

@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='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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flang:frontendquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions