1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Test visibility restrictions
5 integer, private
:: ip1
= 123
8 generic
:: write(formatted
) => fwrite1
11 integer, private
:: ip2
= 234
18 type, extends(t2
) :: t4
21 subroutine fwrite1(x
, unit
, iotype
, vlist
, iostat
, iomsg
)
22 class(t1
), intent(in
) :: x
23 integer, intent(in
) :: unit
24 character(*), intent(in
) :: iotype
25 integer, intent(in
) :: vlist(:)
26 integer, intent(out
) :: iostat
27 character(*), intent(in out
) :: iomsg
28 write(unit
, *, iostat
=iostat
, iomsg
=iomsg
) '(', iotype
, ':', vlist
, ':', x
%ip1
, ')'
30 subroutine local
! all OK since type is local
49 !ERROR: I/O of the derived type 't2' may not be performed without defined I/O in a scope in which a direct component like 'ip2' is inaccessible
51 !ERROR: I/O of the derived type 't3' may not be performed without defined I/O in a scope in which a direct component like 'ip2' is inaccessible
53 !ERROR: I/O of the derived type 't4' may not be performed without defined I/O in a scope in which a direct component like 'ip2' is inaccessible