Skip to content

[flang] Allocation should continue even if one of the allocate-object failed #155500

@DanielCChen

Description

@DanielCChen

Consider the following code:

class(*), allocatable :: a(:), a1
integer :: stat
allocate(real:: a1)
allocate(real :: a1, a(2:4), stat=stat)
print*, allocated(a)
end

a1 is allocated multiple time, which will result an runtime error. However, the allocation of a should complete.

If I swap a1 and a in the 2nd allocate statement, a is allocated successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    flang:frontendflang:runtimequestionA 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