<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60223>60223</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Compilation error of argument with the ALLOCABLE attribute specified in the ALLOCATE statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
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
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVUuP4jgQ_jXmUgI5zgsOOdA8pJVaO6vd1l5XTlIOHjk26wc9_e9HTgJkGA7dKHJc4fNXVV_ZZe6c7DRiRfIXku8XPPiTsZU5abMU3xe1aT8qUtDpoXtCt_-iddJoMAKE4rpbanwHkm4hKVZ0RQlbl6VgIs3aYlPUZSkwrwXNuaixTNfFpijqom6adc0J24yUDx7G8U5-tlJ7ByZ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