Skip to content

[Flang] Incorrect diagnostic on sequence association of character type arguments #123807

@DanielCChen

Description

@DanielCChen

Consider the following code

module m
    contains

    subroutine test2 (s)
        character(5), intent(inout) :: s(5)

    !    s = (/character(5) :: 'POINT', 'COMMA', 'UNDEFINED', '',''/)
    end subroutine

end module

use m
    character(30), allocatable :: s3

    allocate (s3)
    s3 = ''

    call test2(s3)
    end

Flang currently issues an error as:

./t.f:18:16: error: Actual argument has fewer characters remaining in storage sequence (24) than dummy argument 's=' (25)
      call test2(s3)
                 ^^

This is sequence association. It is allowed to have different length between actual and dummy character type argument.
All ifort, gfortran and XLF compiled the code successfully.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions