Issue |
133670
|
Summary |
[Flang] Compile error when argument keyword is specified in argument of c_sizeof intrinsic module function
|
Labels |
flang:frontend
|
Assignees |
|
Reporter |
ohno-fj
|
```
Version of flang : 21.0.0(b2b3cb5f76f15d38e67f70124d275a5696bfdb83)/AArch64
```
When `argument keyword` is specified in `argument (actual argument specifier)` of `c_sizeof intrinsic module function`, a compilation error occurs.
Although the types of `intrinsic module functions` are different, this issue is similar to [128610] (https://github.com/llvm/llvm-project/issues/128610).
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
sngtm016_2.f90:
```fortran
program main
use iso_c_binding
real(c_float) :: r
real(c_float),pointer ::p
type(c_ptr) :: leftptr
print *,c_sizeof(r)
print *,c_sizeof(x=r)
leftptr=c_loc(x=p)
end program main
```
```
$ flang sngtm016_2.f90
error: Semantic errors in sngtm016_2.f90
./sngtm016_2.f90:7:20: error: unknown keyword argument to intrinsic 'sizeof'
print *,c_sizeof(x=r)
^
$
```
```
$ gfortran sngtm016_2.f90; ./a.out
4
4
$
```
```
$ ifx sngtm016_2.f90; ./a.out
4
4
$
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs