I have just installed v16 and code which compiled fine with all the previous v16 betas, v15 and v14 now no longer compiles. I get the following error message on lines of code that use UDDTIO, e.g.
subroutine dump_strsum(f) character(len=*), intent(in) :: f integer :: u open(newunit=u,file=f,access='sequential',status='replace') write(u,'(dt)') strsum_data close(u) end subroutine dump_strsum
error #5521: A derived-type object in an input/output list cannot have inaccessible components unless a suitable user-defined input/output procedure is available.
As far as I can see all the components are public so I don't understand why this message has started appearing. Is there a new, more stringent, check? Is there anyway of working out what the actual error is? I have tried disabling error 5521 but that isn't allowed.
Thanks.
連結已複製
I've attached an example which shows the problem.
Basically it seems to be due to a change in the behaviour of the 'only' qualification of the 'use' statement. The type 'strsum_f' is defined through inheritance used with an 'only' qualification:
use file_io, only: strsum_f
However the types from which strsum_f inherit are now excluded so the code doesn't compile. If I change the code to either
use file_io
or
use file_io_base use file_io, only: dir_binary_g use file_io, only: strsum_f
This change seem to limit the usefulness of the 'only' qualification since it requires the application to know what the inheritance tree is which ought to be wrong. Looks like a bug to me.
