View previous topic :: View next topic |
Author |
Message |
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Mon Aug 24, 2015 3:27 pm Post subject: Regression in 7.2 with type initialisation in optional out |
|
|
FTN95 version 7.20 crashes when calling a subroutine/function with an optional, output parameter that is a type with initialiser.
In the following example:
Code: | module TestOptionalParam
type OptionalType
integer:: intVal = 42 ! crash with initialisation, works if omitted
end type OptionalType
contains
subroutine FuncWithOptParam(optParam)
type(OptionalType), optional, intent(out):: optParam
end subroutine FuncWithOptParam
end module TestOptionalParam
program TestOptionalParamFunc
use TestOptionalParam
type(OptionalType):: param
call FuncWithOptParam(param) ! no not crash if param present
call FuncWithOptParam() ! crashes with param missing
end program TestOptionalParamFunc
|
The crash occurs on the second entry to the subroutine. It is caused by the combination of:
. initialisation within the type - if the initialisation is removed the call succeeds
. intent(out) - if this is removed or changed to intent(in out) all is well
. if the optional parameter is included in the call it's okay
This worked fine in 7.10.
Alan |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Mon Aug 24, 2015 3:41 pm Post subject: |
|
|
Thanks for the feedback. I have logged this for investigation. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Tue May 31, 2016 6:48 am Post subject: |
|
|
This has now been fixed for the next release. |
|
Back to top |
|
|
acw
Joined: 04 Nov 2005 Posts: 165 Location: Darkest Devon
|
Posted: Wed Jun 01, 2016 11:10 am Post subject: |
|
|
That's great news - any idea when this will be, I'm keep to use v8 but this bug has been preventing me. |
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7924 Location: Salford, UK
|
Posted: Wed Jun 01, 2016 12:57 pm Post subject: |
|
|
It will be the version after 8.0 but I don't know when that will be released.
Probably a relatively short time given that 8.0 is a major version. |
|
Back to top |
|
|
|