- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I might have stumble upon a compiler bug:
!< Tested on Intel® Parallel Studio XE 2017 Update 4 Composer Edition for Fortran Windows (w_comp_lib_2017.4.210))
module my_module
implicit none
!< A type
type :: A_type
real :: value
contains
procedure :: A_assign_value
generic :: assignment(=) => A_assign_value
end type A_type
!< B type
type, extends(A_type) :: B_type
end type B_type
!< C type
type :: C_type
real :: x
type(A_type) :: A
type(B_type) :: B
end type C_type
!< D type
type :: D_type
real :: x
type(B_type) :: B
type(A_type) :: A
end type D_type
contains
subroutine A_assign_value(this, value)
class(A_type), intent(inout) :: this
real , intent(in) :: value
this%value = value
end subroutine A_assign_value
end module my_module
program bug_test
use my_module
implicit none
type(C_type) :: C
type(D_type) :: D
C = C_type(1.0, A_type(1.0), B_type(1.0))
D = D_type(1.0, B_type(1.0), A_type(1.0))
write(*,*) C%x, D%x !< out: 1.0 0.0
!< By commenting out lines 9 and 10, out: 1.0 1.0
end program bug_test
Thank you.
Nick
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page