55 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12module m3 type dt4 procedure(explicit), pointer, nopass :: p5 end type6 contains7 integer function one()8 one = 19 end10 function onePtr()11 procedure(one), pointer :: onePtr12 onePtr => one13 end14 function explicit15 character(:), allocatable :: explicit16 explicit = "abc"17 end18end19 20program test21 use m22 procedure(), pointer :: p023 procedure(one), pointer :: p124 procedure(integer), pointer :: p225 procedure(explicit), pointer :: p326 external implicit27 type(dt) x28 p0 => one ! ok29 p0 => onePtr() ! ok30 p0 => implicit ! ok31 !ERROR: Procedure pointer 'p0' with implicit interface may not be associated with procedure designator 'explicit' with explicit interface that cannot be called via an implicit interface32 p0 => explicit33 p1 => one ! ok34 p1 => onePtr() ! ok35 p1 => implicit ! ok36 !ERROR: Function pointer 'p1' associated with incompatible function designator 'explicit': function results have incompatible attributes37 p1 => explicit38 p2 => one ! ok39 p2 => onePtr() ! ok40 p2 => implicit ! ok41 !ERROR: Function pointer 'p2' associated with incompatible function designator 'explicit': function results have incompatible attributes42 p2 => explicit43 !ERROR: Function pointer 'p3' associated with incompatible function designator 'one': function results have incompatible attributes44 p3 => one45 !ERROR: Procedure pointer 'p3' associated with result of reference to function 'oneptr' that is an incompatible procedure pointer: function results have incompatible attributes46 p3 => onePtr()47 p3 => explicit ! ok48 !ERROR: Procedure pointer 'p3' with explicit interface that cannot be called via an implicit interface cannot be associated with procedure designator with an implicit interface49 p3 => implicit50 !ERROR: Procedure pointer 'p' with explicit interface that cannot be called via an implicit interface cannot be associated with procedure designator with an implicit interface51 x = dt(implicit)52 !ERROR: Procedure pointer 'p' with explicit interface that cannot be called via an implicit interface cannot be associated with procedure designator with an implicit interface53 x%p => implicit54end55