view gcc/testsuite/gfortran.dg/whole_file_20.f03 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-fcoarray=single" }
!
! Procedures with dummy arguments that are coarrays or polymorphic
! must have an explicit interface in the calling routine.
!

MODULE classtype
  type :: t
    integer :: comp
  end type
END MODULE

PROGRAM main
  USE classtype
  CLASS(t), POINTER :: tt

  INTEGER :: coarr[*]

  CALL coarray(coarr)         ! { dg-error "Explicit interface required" }
  CALL polymorph(tt)          ! { dg-error "Explicit interface required" }
END PROGRAM

SUBROUTINE coarray(a)
  INTEGER :: a[*]
END SUBROUTINE

SUBROUTINE polymorph(b)
  USE classtype
  CLASS(t) :: b
END SUBROUTINE