Issue 78953
Summary [Flang] Intrinsics leaking when USEing a MODULE
Labels flang
Assignees
Reporter mjklemm
    When compiling this code:

```Fortran
subroutine sub()
    use iso_c_binding
    implicit none
    integer :: kind
end subroutine
```

flang complains about `kind` being already defined. (I understand that using variable names that are now used by Fortran is bad style, but that kind of code is out there in the wild.)

It seems like that this is coming from the `kind` intrinsic being used to define `c_size_t' as `kind(c_sizeof(1))`.  In the `.mod` file, then the intrinsic (and also `achar`) is being declared:

```
> cat include/flang/iso_c_binding.f18.mod
!mod$ v1 sum:dc8d285f9386572c
module iso_c_binding
[...]
intrinsic::kind
[...]
intrinsic::achar
[...]
end
```

This seems like a bug, as other compiler happily accept `integer kind`.  Would it be possible to avoid this kind of leaking symbol names?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to