Issue 128610
Summary [Flang] Compile error when argument keyword is used as argument to an extension sizeof intrinsic function
Labels flang:frontend
Assignees
Reporter ohno-fj
    ```
Version of flang : 21.0.0(f75126eeabba13ce2aab53c2e4296fca12b9da0d)/AArch64
```

When `argument keyword (X=)` is used as argument to an extension `sizeof` intrinsic function, a compilation error occurs.

The following are the test program, Flang, Gfortran and ifx compilation/execution result.

sngts014_22.f90:
```fortran
program main
  call s2
  print *,'pass'
contains
  subroutine s2
 integer,parameter::pi41=sizeof(X=1)
    integer::i41
 if(pi41/=sizeof(X=i41)) print *,'err11'
  end subroutine s2
end program main
```

```
$ flang sngts014_22.f90; ./a.out
error: Semantic errors in sngts014_22.f90
./sngts014_22.f90:6:36: error: unknown keyword argument to intrinsic 'sizeof'
      integer,parameter::pi41=sizeof(X=1)
 ^
./sngts014_22.f90:8:21: error: unknown keyword argument to intrinsic 'sizeof'
      if(pi41/=sizeof(X=i41)) print *,'err11'
                      ^
$ 
```

```
$ gfortran sngts014_22.f90; ./a.out
 pass
$ 
```

```
$ ifx sngts014_22.f90; ./a.out
 pass
$ 
```


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to