-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Closed
Labels
flang:frontendquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Description
Consider the following reducer:
module m
type base
real, allocatable :: data
contains
procedure :: uncommonAssgn
generic :: assignment(=) => uncommonAssgn
end type
contains
!! this is rather unusual way to do assignment: choose the larger value
!between LHS and RHS for components
subroutine uncommonAssgn (b1, b2)
class(base), intent(inout) :: b1
class(base), intent(in) :: b2
print*, b1%data !! Should print 10.1
end subroutine
end module
module m1
use m
type container
type(base) data
end type
contains
subroutine assgnCo (co1, co2)
type(container), allocatable :: co1
type(container) co2
co1 = co2
end subroutine
end module
program dummyArg009
use m1
type(container), allocatable :: co1, co2
allocate (co1,co2)
co1%data%data = 10.1
!! test 2
call assgnCo (co1, co2)
end
Flang's output
> a.out
0.
Expected output:
>a.out
10.1
Metadata
Metadata
Assignees
Labels
flang:frontendquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!