833 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12 3! Tests for defined input/output. See 12.6.4.8 and 15.4.3.2, and C7774module m15 type,public :: t6 integer c7 contains8 procedure, nopass :: tbp=>formattedReadProc !Error, NOPASS not allowed9 !ERROR: Defined input/output procedure 'tbp' may not have NOPASS attribute10 generic :: read(formatted) => tbp11 end type12 private13contains14 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)15 class(t), intent(inout) :: dtv16 integer, intent(in) :: unit17 character(len=*), intent(in) :: iotype18 integer, intent(in) :: vlist(:)19 integer, intent(out) :: iostat20 character(len=*), intent(inout) :: iomsg21 22 iostat = 34323 stop 'fail'24 end subroutine25end module m126 27module m228 type,public :: t29 integer c30 contains31 procedure, pass :: tbp=>formattedReadProc32 !ERROR: Defined input/output procedure 'formattedreadproc' must have 6 dummy arguments rather than 533 generic :: read(formatted) => tbp34 end type35 private36contains37 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat)38 class(t), intent(inout) :: dtv39 integer, intent(in) :: unit40 character(len=*), intent(in) :: iotype41 integer, intent(in) :: vlist(:)42 integer, intent(out) :: iostat43 44 iostat = 34345 stop 'fail'46 end subroutine47end module m248 49module m350 type,public :: t51 integer c52 contains53 procedure, pass :: tbp=>unformattedReadProc54 !ERROR: Defined input/output procedure 'unformattedreadproc' must have 4 dummy arguments rather than 555 generic :: read(unformatted) => tbp56 end type57 private58contains59 ! Error bad # of args60 subroutine unformattedReadProc(dtv, unit, iostat, iomsg, iotype)61 class(t), intent(inout) :: dtv62 integer, intent(in) :: unit63 integer, intent(out) :: iostat64 character(len=*), intent(inout) :: iomsg65 integer, intent(out) :: iotype66 67 iostat = 34368 stop 'fail'69 end subroutine70end module m371 72module m473 type,public :: t74 integer c75 contains76 procedure, pass :: tbp=>formattedReadProc77 generic :: read(formatted) => tbp78 end type79 private80contains81 !ERROR: Dummy argument 0 of 'formattedreadproc' must be a data object82 !ERROR: Cannot use an alternate return as the passed-object dummy argument83 subroutine formattedReadProc(*, unit, iotype, vlist, iostat, iomsg)84 !ERROR: Dummy argument 'unit' must be a data object85 !ERROR: A dummy procedure without the POINTER attribute may not have an INTENT attribute86 procedure(real), intent(in) :: unit87 character(len=*), intent(in) :: iotype88 integer, intent(in) :: vlist(:)89 integer, intent(out) :: iostat90 character(len=*), intent(inout) :: iomsg91 92 iostat = 34393 stop 'fail'94 end subroutine95end module m496 97module m598 type,public :: t99 integer c100 contains101 !ERROR: Passed-object dummy argument 'dtv' of procedure 'tbp' must be of type 't' but is 'INTEGER(4)'102 procedure, pass :: tbp=>formattedReadProc103 generic :: read(formatted) => tbp104 end type105 private106contains107 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)108 !ERROR: Dummy argument 'dtv' of a defined input/output procedure must have a derived type109 integer, intent(inout) :: dtv ! error, must be of type t110 integer, intent(in) :: unit111 character(len=*), intent(in) :: iotype112 integer, intent(in) :: vlist(:)113 integer, intent(out) :: iostat114 character(len=*), intent(inout) :: iomsg115 116 iostat = 343117 stop 'fail'118 end subroutine119end module m5120 121module m6122 interface read(formatted)123 procedure :: formattedReadProc124 end interface125 126 contains127 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)128 !ERROR: Dummy argument 'dtv' of a defined input/output procedure must have a derived type129 integer, intent(inout) :: dtv130 integer, intent(in) :: unit131 character(len=*), intent(in) :: iotype ! error, must be deferred132 integer, intent(in) :: vlist(:)133 integer, intent(out) :: iostat134 character(len=*), intent(inout) :: iomsg135 end subroutine136end module m6137 138module m7139 type,public :: t140 integer c141 contains142 procedure, pass :: tbp=>formattedReadProc143 generic :: read(formatted) => tbp144 end type145 private146contains147 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)148 !ERROR: Dummy argument 'dtv' of a defined input/output procedure must have intent 'INTENT(INOUT)'149 class(t), intent(in) :: dtv ! Error, must be intent(inout)150 integer, intent(in) :: unit151 character(len=*), intent(in) :: iotype152 integer, intent(in) :: vlist(:)153 integer, intent(out) :: iostat154 character(len=*), intent(inout) :: iomsg155 156 iostat = 343157 stop 'fail'158 end subroutine159end module m7160 161module m8162 type,public :: t163 integer c164 contains165 procedure, pass :: tbp=>formattedWriteProc166 generic :: write(formatted) => tbp167 end type168 private169contains170 subroutine formattedWriteProc(dtv, unit, iotype, vlist, iostat, iomsg)171 !ERROR: Dummy argument 'dtv' of a defined input/output procedure must have intent 'INTENT(IN)'172 class(t), intent(inout) :: dtv ! Error, must be intent(in)173 integer, intent(in) :: unit174 character(len=*), intent(in) :: iotype175 integer, intent(in) :: vlist(:)176 integer, intent(out) :: iostat177 character(len=*), intent(inout) :: iomsg178 179 iostat = 343180 stop 'fail'181 end subroutine182end module m8183 184module m9185 type,public :: t186 integer c187 contains188 procedure, pass :: tbp=>formattedReadProc189 generic :: read(formatted) => tbp190 end type191 private192contains193 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)194 class(t), intent(inout) :: dtv ! Error, can't have attributes195 !ERROR: Dummy argument 'unit' of a defined input/output procedure may not have any attributes196 integer, pointer, intent(in) :: unit197 character(len=*), intent(in) :: iotype198 integer, intent(in) :: vlist(:)199 integer, intent(out) :: iostat200 character(len=*), intent(inout) :: iomsg201 202 iostat = 343203 stop 'fail'204 end subroutine205end module m9206 207module m10208 type,public :: t209 integer c210 contains211 procedure, pass :: tbp=>formattedReadProc212 generic :: read(formatted) => tbp213 end type214 private215contains216 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)217 class(t), intent(inout) :: dtv218 !ERROR: Dummy argument 'unit' of a defined input/output procedure must be an INTEGER of default KIND219 real, intent(in) :: unit ! Error, must be an integer220 character(len=*), intent(in) :: iotype221 integer, intent(in) :: vlist(:)222 integer, intent(out) :: iostat223 character(len=*), intent(inout) :: iomsg224 225 iostat = 343226 stop 'fail'227 end subroutine228end module m10229 230module m11231 type,public :: t232 integer c233 contains234 procedure, pass :: tbp=>formattedReadProc235 generic :: read(formatted) => tbp236 end type237 private238contains239 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)240 class(t), intent(inout) :: dtv241 !ERROR: Dummy argument 'unit' of a defined input/output procedure must be an INTEGER of default KIND242 integer(8), intent(in) :: unit ! Error, must be default KIND243 character(len=*), intent(in) :: iotype244 integer, intent(in) :: vlist(:)245 integer, intent(out) :: iostat246 character(len=*), intent(inout) :: iomsg247 248 iostat = 343249 stop 'fail'250 end subroutine251end module m11252 253module m12254 type,public :: t255 integer c256 contains257 procedure, pass :: tbp=>formattedReadProc258 generic :: read(formatted) => tbp259 end type260 private261contains262 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)263 class(t), intent(inout) :: dtv264 !ERROR: Dummy argument 'unit' of a defined input/output procedure must be a scalar265 integer, dimension(22), intent(in) :: unit ! Error, must be a scalar266 character(len=*), intent(in) :: iotype267 integer, intent(in) :: vlist(:)268 integer, intent(out) :: iostat269 character(len=*), intent(inout) :: iomsg270 271 iostat = 343272 stop 'fail'273 end subroutine274end module m12275 276module m13277 type,public :: t278 integer c279 contains280 procedure, pass :: tbp=>formattedReadProc281 generic :: read(formatted) => tbp282 end type283 private284contains285 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)286 class(t), intent(inout) :: dtv287 !ERROR: Dummy argument 'unit' of a defined input/output procedure must have intent 'INTENT(IN)'288 integer, intent(out) :: unit !Error, must be intent(in)289 character(len=*), intent(in) :: iotype290 integer, intent(in) :: vlist(:)291 integer, intent(out) :: iostat292 character(len=*), intent(inout) :: iomsg293 294 iostat = 343295 stop 'fail'296 end subroutine297end module m13298 299module m14300 type,public :: t301 integer c302 contains303 procedure, pass :: tbp=>formattedReadProc304 generic :: read(formatted) => tbp305 end type306 private307contains308 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)309 class(t), intent(inout) :: dtv310 !ERROR: Dummy argument 'unit' of a defined input/output procedure must have intent 'INTENT(IN)'311 integer :: unit !Error, must be INTENT(IN)312 character(len=*), intent(in) :: iotype313 integer, intent(in) :: vlist(:)314 integer, intent(out) :: iostat315 character(len=*), intent(inout) :: iomsg316 317 iostat = 343318 stop 'fail'319 end subroutine320end module m14321 322module m15323 type,public :: t324 integer c325 contains326 procedure, pass :: tbp=>formattedReadProc327 generic :: read(formatted) => tbp328 end type329 private330contains331 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)332 class(t), intent(inout) :: dtv333 integer, intent(in) :: unit334 !ERROR: Dummy argument 'iotype' of a defined input/output procedure must be assumed-length CHARACTER of default kind335 character(len=5), intent(in) :: iotype ! Error, must be assumed length336 integer, intent(in) :: vlist(:)337 integer, intent(out) :: iostat338 !ERROR: Dummy argument 'iomsg' of a defined input/output procedure must be assumed-length CHARACTER of default kind339 character(len=5), intent(inout) :: iomsg340 iostat = 343341 stop 'fail'342 end subroutine343end module m15344 345module m16a346 type,public :: t347 integer c348 contains349 procedure, pass :: tbp=>formattedReadProc350 generic :: read(formatted) => tbp351 end type352 private353contains354 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)355 class(t), intent(inout) :: dtv356 integer, intent(in) :: unit357 character(len=*), intent(in) :: iotype358 !ERROR: Dummy argument 'vlist' of a defined input/output procedure must be assumed shape vector359 integer, intent(in) :: vlist(5)360 integer, intent(out) :: iostat361 character(len=*), intent(inout) :: iomsg362 iostat = 343363 stop 'fail'364 end subroutine365end module m16a366 367module m16b368 type,public :: t369 integer c370 contains371 procedure, pass :: tbp=>formattedReadProc372 generic :: read(formatted) => tbp373 end type374 private375contains376 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)377 class(t), intent(inout) :: dtv378 integer, intent(in) :: unit379 character(len=*), intent(in) :: iotype380 !ERROR: Dummy argument 'vlist' of a defined input/output procedure must be assumed shape vector381 integer, intent(in) :: vlist(:,:)382 integer, intent(out) :: iostat383 character(len=*), intent(inout) :: iomsg384 iostat = 343385 stop 'fail'386 end subroutine387end module m16b388 389module m16c390 type,public :: t391 integer c392 contains393 procedure, pass :: tbp=>formattedReadProc394 generic :: read(formatted) => tbp395 end type396 private397contains398 subroutine formattedReadProc(dtv, unit, iotype, vlist, iostat, iomsg)399 class(t), intent(inout) :: dtv400 integer, intent(in) :: unit401 character(len=*), intent(in) :: iotype402 !ERROR: Dummy argument 'vlist' may not be assumed-rank403 integer, intent(in) :: vlist(..)404 integer, intent(out) :: iostat405 character(len=*), intent(inout) :: iomsg406 iostat = 343407 stop 'fail'408 end subroutine409end module m16c410 411module m17412 ! Test the same defined input/output procedure specified as a generic413 type t414 integer c415 contains416 procedure :: formattedReadProc417 end type418 419 interface read(formatted)420 module procedure formattedReadProc421 end interface422 423contains424 subroutine formattedReadProc(dtv,unit,iotype,v_list,iostat,iomsg)425 class(t),intent(inout) :: dtv426 integer,intent(in) :: unit427 character(*),intent(in) :: iotype428 integer,intent(in) :: v_list(:)429 integer,intent(out) :: iostat430 character(*),intent(inout) :: iomsg431 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c432 print *,v_list433 end subroutine434end module435 436module m18437 ! Test the same defined input/output procedure specified as a type-bound438 ! procedure and as a generic439 type t440 integer c441 contains442 procedure :: formattedReadProc443 generic :: read(formatted) => formattedReadProc444 end type445 interface read(formatted)446 module procedure formattedReadProc447 end interface448contains449 subroutine formattedReadProc(dtv,unit,iotype,v_list,iostat,iomsg)450 class(t),intent(inout) :: dtv451 integer,intent(in) :: unit452 character(*),intent(in) :: iotype453 integer,intent(in) :: v_list(:)454 integer,intent(out) :: iostat455 character(*),intent(inout) :: iomsg456 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c457 print *,v_list458 end subroutine459end module460 461module m19462 ! Test two different defined input/output procedures specified as a463 ! type-bound procedure and as a generic for the same derived type464 type t465 integer c466 contains467 procedure :: unformattedReadProc1468 generic :: read(unformatted) => unformattedReadProc1469 end type470 interface read(unformatted)471 module procedure unformattedReadProc472 end interface473contains474 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)475 class(t),intent(inout) :: dtv476 integer,intent(in) :: unit477 integer,intent(out) :: iostat478 character(*),intent(inout) :: iomsg479 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c480 end subroutine481 !ERROR: Derived type 't' has conflicting type-bound input/output procedure 'read(unformatted)'482 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)483 class(t),intent(inout) :: dtv484 integer,intent(in) :: unit485 integer,intent(out) :: iostat486 character(*),intent(inout) :: iomsg487 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c488 end subroutine489end module490 491module m20492 ! Test read and write defined input/output procedures specified as a493 ! type-bound procedure and as a generic for the same derived type494 type t495 integer c496 contains497 procedure :: unformattedReadProc498 generic :: read(unformatted) => unformattedReadProc499 end type500 interface read(unformatted)501 module procedure unformattedReadProc502 end interface503 interface write(unformatted)504 module procedure unformattedWriteProc505 end interface506contains507 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)508 class(t),intent(inout) :: dtv509 integer,intent(in) :: unit510 integer,intent(out) :: iostat511 character(*),intent(inout) :: iomsg512 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c513 end subroutine514 subroutine unformattedWriteProc(dtv,unit,iostat,iomsg)515 class(t),intent(in) :: dtv516 integer,intent(in) :: unit517 integer,intent(out) :: iostat518 character(*),intent(inout) :: iomsg519 write(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c520 end subroutine521end module522 523module m21524 ! Test read and write defined input/output procedures specified as a 525 ! type-bound procedure and as a generic for the same derived type with a526 ! KIND type parameter where they both have the same value527 type t(typeParam)528 integer, kind :: typeParam = 4529 integer c530 contains531 procedure :: unformattedReadProc532 generic :: read(unformatted) => unformattedReadProc533 end type534 interface read(unformatted)535 module procedure unformattedReadProc1536 end interface537contains538 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)539 class(t),intent(inout) :: dtv540 integer,intent(in) :: unit541 integer,intent(out) :: iostat542 character(*),intent(inout) :: iomsg543 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c544 end subroutine545 !ERROR: Derived type 't' has conflicting type-bound input/output procedure 'read(unformatted)'546 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)547 class(t(4)),intent(inout) :: dtv548 integer,intent(in) :: unit549 integer,intent(out) :: iostat550 character(*),intent(inout) :: iomsg551 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c552 end subroutine553end module554 555module m22556 ! Test read and write defined input/output procedures specified as a557 ! type-bound procedure and as a generic for the same derived type with a558 ! KIND type parameter where they have different values559 type t(typeParam)560 integer, kind :: typeParam = 4561 integer c562 contains563 procedure :: unformattedReadProc564 generic :: read(unformatted) => unformattedReadProc565 end type566 interface read(unformatted)567 module procedure unformattedReadProc1568 end interface569contains570 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)571 class(t),intent(inout) :: dtv572 integer,intent(in) :: unit573 integer,intent(out) :: iostat574 character(*),intent(inout) :: iomsg575 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c576 end subroutine577 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)578 class(t(3)),intent(inout) :: dtv579 integer,intent(in) :: unit580 integer,intent(out) :: iostat581 character(*),intent(inout) :: iomsg582 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c583 end subroutine584end module585 586module m23587 type t(typeParam)588 ! Test read and write defined input/output procedures specified as a589 ! type-bound procedure and as a generic for the same derived type with a590 ! KIND type parameter where they have different values591 integer, kind :: typeParam = 4592 integer c593 contains594 procedure :: unformattedReadProc595 generic :: read(unformatted) => unformattedReadProc596 end type597 interface read(unformatted)598 module procedure unformattedReadProc1599 end interface600contains601 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)602 class(t(2)),intent(inout) :: dtv603 integer,intent(in) :: unit604 integer,intent(out) :: iostat605 character(*),intent(inout) :: iomsg606 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c607 end subroutine608 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)609 class(t(3)),intent(inout) :: dtv610 integer,intent(in) :: unit611 integer,intent(out) :: iostat612 character(*),intent(inout) :: iomsg613 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c614 end subroutine615end module616 617module m23a618 type t(typeParam)619 ! Test read and write defined input/output procedures specified as a620 ! type-bound procedure and as a generic for the same derived type with a621 ! KIND type parameter where they have the same value622 integer, kind :: typeParam = 4623 integer c624 contains625 procedure :: unformattedReadProc626 generic :: read(unformatted) => unformattedReadProc627 end type628 interface read(unformatted)629 module procedure unformattedReadProc1630 end interface631contains632 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)633 class(t),intent(inout) :: dtv634 integer,intent(in) :: unit635 integer,intent(out) :: iostat636 character(*),intent(inout) :: iomsg637 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c638 end subroutine639 !ERROR: Derived type 't' has conflicting type-bound input/output procedure 'read(unformatted)'640 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)641 class(t(4)),intent(inout) :: dtv642 integer,intent(in) :: unit643 integer,intent(out) :: iostat644 character(*),intent(inout) :: iomsg645 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c646 end subroutine647end module648 649module m24650 ! Test read and write defined input/output procedures specified as a 651 ! type-bound procedure and as a generic for the same derived type with a652 ! LEN type parameter where they are both assumed653 type t(typeParam)654 integer, len :: typeParam = 4655 integer c656 contains657 procedure :: unformattedReadProc658 generic :: read(unformatted) => unformattedReadProc659 end type660 interface read(unformatted)661 module procedure unformattedReadProc1662 end interface663contains664 subroutine unformattedReadProc(dtv,unit,iostat,iomsg)665 class(t(*)),intent(inout) :: dtv666 integer,intent(in) :: unit667 integer,intent(out) :: iostat668 character(*),intent(inout) :: iomsg669 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c670 end subroutine671 !ERROR: Derived type 't' has conflicting type-bound input/output procedure 'read(unformatted)'672 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)673 class(t(*)),intent(inout) :: dtv674 integer,intent(in) :: unit675 integer,intent(out) :: iostat676 character(*),intent(inout) :: iomsg677 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c678 end subroutine679end module680 681module m25a682 ! Test against false error when two defined I/O procedures exist683 ! for the same type but are not both visible in the same scope.684 type t685 integer c686 end type687 interface read(unformatted)688 module procedure unformattedReadProc1689 end interface690 contains691 subroutine unformattedReadProc1(dtv,unit,iostat,iomsg)692 class(t),intent(inout) :: dtv693 integer,intent(in) :: unit694 integer,intent(out) :: iostat695 character(*),intent(inout) :: iomsg696 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c697 end subroutine698end module699subroutine m25b700 use m25a, only: t701 interface read(unformatted)702 procedure unformattedReadProc2703 end interface704 contains705 subroutine unformattedReadProc2(dtv,unit,iostat,iomsg)706 class(t),intent(inout) :: dtv707 integer,intent(in) :: unit708 integer,intent(out) :: iostat709 character(*),intent(inout) :: iomsg710 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c711 end subroutine712end subroutine713 714module m26a715 type t716 integer n717 end type718 contains719 subroutine unformattedRead(dtv,unit,iostat,iomsg)720 class(t),intent(inout) :: dtv721 integer,intent(in) :: unit722 integer,intent(out) :: iostat723 !ERROR: Dummy argument 'iomsg' of a defined input/output procedure must be assumed-length CHARACTER of default kind724 character(kind=4,len=*),intent(inout) :: iomsg725 !ERROR: Must have default kind(1) of CHARACTER type, but is CHARACTER(KIND=4,LEN=*)726 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%n727 end subroutine728end729module m26b730 use m26a731 interface read(unformatted)732 procedure unformattedRead733 end interface734end735 736module m27a737 type t738 integer c739 contains740 procedure ur1741 generic, private :: read(unformatted) => ur1742 end type743 contains744 subroutine ur1(dtv,unit,iostat,iomsg)745 class(t),intent(inout) :: dtv746 integer,intent(in) :: unit747 integer,intent(out) :: iostat748 character(*),intent(inout) :: iomsg749 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c750 end751end752module m27b753 use m27a754 interface read(unformatted)755 module procedure ur2 ! ok, t's generic is inaccessible756 end interface757 contains758 subroutine ur2(dtv,unit,iostat,iomsg)759 class(t),intent(inout) :: dtv760 integer,intent(in) :: unit761 integer,intent(out) :: iostat762 character(*),intent(inout) :: iomsg763 read(unit,iotype,iostat=iostat,iomsg=iomsg) dtv%c764 end765end766 767module m28768 type t769 contains770 procedure, private :: write1771 generic :: write(formatted) => write1772 end type773 abstract interface774 subroutine absWrite(dtv, unit, iotype, v_list, iostat, iomsg)775 import t776 class(t), intent(in) :: dtv777 integer, intent(in) :: unit778 character(*), intent(in) :: iotype779 integer, intent(in) :: v_list(:)780 integer, intent(out) :: iostat781 character(*), intent(inout) :: iomsg782 end783 end interface784 !ERROR: Derived type 't' has conflicting type-bound input/output procedure 'write(formatted)'785 procedure(absWrite) write1, write2786 interface write(formatted)787 procedure write2788 end interface789end790 791module m29792 type t793 end type794 interface write(formatted)795 subroutine wf(dtv, unit, iotype, v_list, iostat, iomsg)796 import t797 !ERROR: Dummy argument 'dtv' of defined input/output procedure 'wf' may not be a coarray798 class(t), intent(in) :: dtv[*]799 !ERROR: Dummy argument 'unit' of defined input/output procedure 'wf' may not be a coarray800 integer, intent(in) :: unit[*]801 !ERROR: Dummy argument 'iotype' of defined input/output procedure 'wf' may not be a coarray802 character(len=*), intent(in) :: iotype[*]803 !ERROR: Dummy argument 'v_list' of defined input/output procedure 'wf' may not be a coarray804 integer, intent(in) :: v_list(:)[*]805 !ERROR: Dummy argument 'iostat' of defined input/output procedure 'wf' may not be a coarray806 integer, intent(out) :: iostat[*]807 !ERROR: Dummy argument 'iomsg' of defined input/output procedure 'wf' may not be a coarray808 character(len=*), intent(inout) :: iomsg[*]809 end810 end interface811end812 813module m30814 type base815 character(5), allocatable :: data816 end type817 interface write(formatted)818 subroutine formattedRead (dtv, unit, iotype, v_list, iostat, iomsg)819 import base820 !ERROR: Dummy argument 'dtv' of a defined input/output procedure must be a scalar821 class (base), intent(in) :: dtv(10)822 integer, intent(in) :: unit823 !ERROR: Dummy argument 'iotype' of a defined input/output procedure must be a scalar824 character(*), intent(in) :: iotype(2)825 integer, intent(in) :: v_list(:)826 !ERROR: Dummy argument 'iostat' of a defined input/output procedure must be a scalar827 integer, intent(out) :: iostat(*)828 !ERROR: Dummy argument 'iomsg' of a defined input/output procedure must be a scalar829 character(*), intent(inout) :: iomsg(:)830 end subroutine831 end interface832end module833