- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I recently came across a problem with the Intel Fortran compiler, where building code that renames a Fortran 2003 derived type from a different module leads to a compiler error:
module type_a_mod
type :: type_a
contains
final :: type_a_destructor
end type type_a
contains
subroutine type_a_destructor(self)
type(type_a) :: self
end subroutine type_a_destructor
end module type_a_mod
module type_rename_mod
use type_a_mod, only: type_b => type_a, type_c => type_a
private
public :: type_b, type_c
end module type_rename_mod
program test_rename
use type_rename_mod, only: type_b
end program test_rename
Intel Fortran v2021.6.0 fails with error message
error #6402: prPromoteSym : Illegal KIND & CLASS mix [TYPE_A_DESTRUCTOR]
However, it will compile this code when either the second type renaming statement ("type_c => type_a") or the "private" declaration in "type_rename_mod" are disabled.
I tried different compiler versions - Intel Fortran v17.0.4, Intel Fortran v18.0.1, gfortran v9.2.0, and gfortran v12.1.0 are able to compile the code, but Intel Fortran v19.0.5.281, Intel Fortran v19.1.3.304, and Intel Fortran v2021.6.0 fail. This looks like a compiler bug to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, looks like a bug. We'll get a bug report started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bug ID is CMPLRLLV-38497
Thank you for sending this to us.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great, thanks, Ron!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page