52 lines · plain
1! RUN: %flang_fc1 -fdebug-unparse %s 2>&1 | FileCheck %s2 3module m14 type foo5 integer n6 integer :: m = 17 end type8end9 10module m211 use m112 interface foo13 module procedure f114 end interface15 contains16 type(foo) function f1(a)17 real, intent(in) :: a18 f1%n = a19 f1%m = 220 end21end22 23module m324 use m225 interface foo26 module procedure f227 end interface28 contains29 type(foo) function f2(a)30 double precision, intent(in) :: a31 f2%n = a32 f2%m = 333 end34end35 36!CHECK: portability: Reference to generic function 'foo' (resolving to specific 'f1') is ambiguous with a structure constructor of the same name37!CHECK: portability: Reference to generic function 'foo' (resolving to specific 'f2') is ambiguous with a structure constructor of the same name38 39program main40 use m341 type(foo) x42!CHECK: foo(n=1_4,m=1_4)43 x = foo(1)44 print *, x45!CHECK: f1(2._4)46 x = foo(2.)47 print *, x48!CHECK: f2(3._8)49 x = foo(3.d0)50 print *, x51end52