<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61449>61449</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] compilation failed with "The left-hand side of a pointer assignment is not definable"
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Test code:
```console
$ cat map_any_type1.f90
module map_any_type
implicit none
type :: list_item
character(:), allocatable :: key
type(list_item), pointer :: next => null(), prev => null()
end type list_item
type, public :: map_any
type(list_item), pointer :: first => null()
end type map_any
contains
subroutine append_list_item (this, item)
class(map_any), intent(inout) :: this
type(list_item), pointer, intent(in) :: item
type(list_item), pointer :: tail
if (associated(this%first)) then
tail => this%first%prev
tail%next => item
item%prev => tail
this%first%prev => item
else
item%prev => item
this%first => item
end if
end subroutine append_list_item
end module map_any_type
```
Compilation result:
```console
$ gfortran -c map_any_type1.f90
$ flang-new -c map_any_type1.f90
error: Semantic errors in map_any_type1.f90
./map_any_type1.f90:22:7: error: The left-hand side of a pointer assignment is not definable
item%prev => tail
^^^^^^^^^^^^^^^^^
./map_any_type1.f90:22:7: because: 'item' is an INTENT(IN) dummy argument
item%prev => tail
^^^^^^^^^^^^^^^^^
./map_any_type1.f90:17:45: Declaration of 'item'
type(list_item), pointer, intent(in) :: item
^^^^
./map_any_type1.f90:25:7: error: The left-hand side of a pointer assignment is not definable
item%prev => item
^^^^^^^^^^^^^^^^^
./map_any_type1.f90:25:7: because: 'item' is an INTENT(IN) dummy argument
item%prev => item
^^^^^^^^^^^^^^^^^
./map_any_type1.f90:17:45: Declaration of 'item'
type(list_item), pointer, intent(in) :: item
^^^^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVsGOozgQ_RrnUkpETCBw4NDb6Uhz6cv2vVWYInjH2Mg205u_XxlCQno7M2ntzo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