1! { dg-do compile } 2! This program would segfault without the patch for PR fortran/24005. 3module y 4 ! 5 ! If private statement is removed, then we get a bunch of errors 6 ! 7 private f 8 ! 9 ! If we rename 'f' in module y to say 'g', then gfortran correctly 10 ! identifies ambiguous as being ambiguous. 11 ! 12 interface ambiguous 13 module procedure f 14 end interface 15 16 contains 17 18 real function f(a) 19 real a 20 f = a 21 end function 22 23end module y 24 25module z 26 27 use y ! { dg-warning "in generic interface" } 28 29 interface ambiguous 30 module procedure f 31 end interface 32 33 contains 34 35 real function f(a) ! { dg-warning "in generic interface" } 36 real a 37 f = a 38 end function 39 40end module z 41