Issue |
60225
|
Summary |
[flang] Compilation error of omission of actual argument
|
Labels |
|
Assignees |
|
Reporter |
ohno-fj
|
```
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
$
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs