82 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m23 public s2, s44 private s35contains6 subroutine s27 end8 subroutine s39 end10 subroutine s411 end12end module13 14module m15 use m216 external bar17 interface18 subroutine foo19 end subroutine20 end interface21 abstract interface22 subroutine absfoo23 end subroutine24 end interface25 integer :: i26 type t127 integer :: c28 contains29 !ERROR: The binding of 'a' ('missing') must be either an accessible module procedure or an external procedure with an explicit interface30 procedure, nopass :: a => missing31 procedure, nopass :: b => s, s232 !ERROR: Type parameter, component, or procedure binding 'c' already defined in this type33 procedure, nopass :: c34 !ERROR: DEFERRED is only allowed when an interface-name is provided35 procedure, nopass, deferred :: d => s36 !Note: s3 not found because it's not accessible -- should we issue a message37 !to that effect?38 !ERROR: 's3' must be either an accessible module procedure or an external procedure with an explicit interface39 procedure, nopass :: s340 procedure, nopass :: foo41 !ERROR: 'absfoo' must be either an accessible module procedure or an external procedure with an explicit interface42 procedure, nopass :: absfoo43 !ERROR: 'bar' must be either an accessible module procedure or an external procedure with an explicit interface44 procedure, nopass :: bar45 !ERROR: 'i' must be either an accessible module procedure or an external procedure with an explicit interface46 procedure, nopass :: i47 !ERROR: Type parameter, component, or procedure binding 'b' already defined in this type48 procedure, nopass :: b => s449 !ERROR: DEFERRED is required when an interface-name is provided50 procedure(foo), nopass :: g51 end type52 type, abstract :: t1a ! DEFERRED valid only in ABSTRACT derived type53 contains54 procedure(foo), nopass, deferred :: e55 procedure(s), nopass, deferred :: f56 !ERROR: Type parameter, component, or procedure binding 'f' already defined in this type57 procedure(foo), nopass, deferred :: f58 !ERROR: 'bar' must be an abstract interface or a procedure with an explicit interface59 procedure(bar), nopass, deferred :: h60 end type61 type t262 integer :: i63 contains64 procedure, nopass :: b => s65 final :: f66 !ERROR: FINAL subroutine 'i' of derived type 't2' must be a module procedure67 final :: i68 end type69 type t370 contains71 private72 procedure, nopass :: b => s73 procedure, nopass, public :: f74 end type75contains76 subroutine s77 end78 subroutine f(x)79 type(t2) :: x80 end81end module82