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

    <tr>
        <th>Summary</th>
        <td>
            [flang] Compilation error of omission of actual argument
        </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)
```

Omission of actual argument results in a compilation-time error.

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

snggj359_4.f90:
```fortran
program main
  call sub1
  print *,'OK'
end program main

module m1
contains
 recursive subroutine sub(a1,a2)
    optional::a1
    interface
 function a1(i) result(r)
         character(len=i),pointer::r
 end function a1
    end interface
 character(len=*),allocatable,optional::a2(:)
  end subroutine sub
end module m1

subroutine sub1
  use m1
  interface
     function func1(i) result(r)
       character(len=i),pointer::r
     end function func1
  end interface
  character,pointer:: a1
 character,allocatable:: a2(:)
  allocate(a1,a2(2))
! a1='0'; a2='1'; call sub(a1=func1,a2=a2); write(6,*) "a1 = ", a1, "  a2 = ", a2
 a1='0'; a2='2'; call sub(         a2=a2); write(6,*) "a1 = ", a1, "  a2 = ", a2
  deallocate (a1,a2)
end subroutine sub1

function func1(i) result(r)
  character(len=i),pointer::r
 allocate(r);r='1234'
end function func1
```

```
$ flang-new -flang-experimental-exec snggj359_4.f90
error: loc("./snggj359_4.f90":30:19): 'fir.absent' op result #0 must be any reference or box like, but got 'tuple<!fir.boxproc<() -> ()>, i64>'
error: verification of lowering to FIR failed
$
```

```
$ gfortran snggj359_4.f90
$
```

```
$ ifort snggj359_4.f90
$
```

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