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

    <tr>
        <th>Summary</th>
        <td>
            [flang] false semantic error in procedure pointer initialization
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          ivan-pi
      </td>
    </tr>
</table>

<pre>
    The following program (compiler explorer link: https://godbolt.org/z/1oYa1ooKK) is believed to be valid Fortran 2008 code:

```fortran
! dispatch_test.f90 --
!   Dispatch table using procedure pointers
module dispatch
implicit none
private
public :: table
abstract interface
    subroutine void()
    end subroutine
end interface
! Procedure container
type :: pp
    procedure(void), pointer, nopass :: pf => null()
end type
! Dispatch table
type(pp), parameter :: table(3) = [pp(a),pp(b),pp(c)]
contains
    subroutine a()
    print *, "A"
    end subroutine
    subroutine b()
 print *, "B"
    end subroutine
    subroutine c()
    print *, "C"
    end subroutine
end module

program test
use dispatch
implicit none
integer :: i
do i = 1, 3
call table(i)%pf()
end do
end program
```

The expected output is:
```txt
 ~/dispatch_test$ nagfor -f2008 dispatch_test.f90 && ./a.out
NAG Fortran Compiler Release 7.1(Hanzomon) Build 7101
[NAG Fortran Compiler normal termination]
 A
 B
 C
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVU2P4zYM_TXyhUhgy3FsH3yYTOoWWKAoil56KmSLTtjKkiDJ6ewc-tsL2c7HZBfdLhBEMiU-vkdRlPCeThqxYcWBFcdETOFsXEMXoTeWks7Iz81vZ4TBKGX-Jn0C68zJiREYr3ozWlLoAN-sMg4dKNJ_sfwFziFYz_IXxlvG25ORnVFha9yJ8fad8TYzv4vMmE-fGK-BPHSoCC8oIRjoEC5CkYTWuOCEBp6mFfRGYgRMjyy9_u_T5TcsG1crz0CStyL05z8C-rAd6hQ2m_sqwHFdhyA6hTD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