1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 ! Check for distinguishability of defined I/O procedures defined within
3 ! and outside their types.
8 procedure :: readt1a, readt1b
9 !ERROR: Generic 'read(unformatted)' may not have specific procedures 'readt1a' and 'readt1b' as their interfaces are not distinguishable
10 generic :: read(unformatted) => readt1a, readt1b
18 !ERROR: Generic 'read(unformatted)' may not have specific procedures 'readt2a' and 'readt2b' as their interfaces are not distinguishable
19 interface read(unformatted)
20 module procedure :: readt1a, readt2a, readt2b, readt3
23 #define DEFINE_READU(name, type) \
24 subroutine name(dtv, unit, iostat, iomsg); \
25 class(type), intent(in out) :: dtv; \
26 integer, intent(in) :: unit; \
27 integer, intent(out) :: iostat; \
28 character(*), intent(in out) :: iomsg; \
29 read(unit, iostat=iostat, iomsg=iomsg) dtv%n; \
31 !ERROR: Derived type 't1' already has defined input/output procedure 'read(unformatted)'
32 DEFINE_READU(readt1a, t1)
33 DEFINE_READU(readt1b, t1)
34 DEFINE_READU(readt2a, t2)
35 DEFINE_READU(readt2b, t2)
36 DEFINE_READU(readt3, t3)