Issue 60223
Summary [flang] Compilation error of argument with the ALLOCABLE attribute specified in the ALLOCATE statement
Labels
Assignees
Reporter ohno-fj
    ```
Version of flang-new : 16.0.0(77f2f34d696b77fe5bf05afbe7386966b6bcc8ba)
```

flang-new prints out that the ALLOCATE statement requires the ALLOCATABLE or POINTER attribute as an argument even if the argument is actually ALLOCATABLE.

The following are the test program, flang-new, gfortran and ifort compilation result.

snggm016_2.f90:
```fortran
module mod
  type t1
     integer,allocatable :: e1(:)
  end type t1
 type(t1),allocatable :: mv3(:,:)
end module mod

program main
 use mod,uv3=>mv3
  call sub()
contains
  subroutine sub()
    use mod,mv3=>mv3
    integer :: error = 0
    allocate(mv3(2,2))
    if (allocated(uv3(1,1)%e1)) error = error+1
    deallocate(uv3)
  end subroutine sub
end program main
```

```
$ flang-new -flang-experimental-exec snggm016_2.f90
error: Semantic errors in snggm016_2.f90
./snggm016_2.f90:15:14: error: Entity in ALLOCATE statement must have the ALLOCATABLE or POINTER attribute
 allocate(mv3(2,2))
               ^^^
$
```

```
$ gfortran snggm016_2.f90
$
```

```
$ ifort snggm016_2.f90
$
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to