2 ! Tests the fix for PR20880, which was due to failure to the failure
3 ! to detect the USE association of a nameless interface for a
4 ! procedure with the same name as the encompassing scope.
6 ! Contributed by Joost VandeVondele <jv244@cam.ac.uk>
30 ! This is the original PR, excepting that the error requires the symbol
35 call my_sub (a
) ! { dg-error "ambiguous reference" }
39 integer function my_fun (a
)
43 my_fun
= 1 ! { dg-error "ambiguous reference" }
46 ! This was found whilst investigating => segfault
47 subroutine thy_sub (a
)
49 subroutine thy_sub (a
) ! { dg-error "enclosing procedure" }
57 subroutine thy_fun (a
)
59 use test_mod2
! OK because there is no reference to my_fun
61 end subroutine thy_fun
63 subroutine his_fun (a
)
66 print *, my_fun (a
) ! { dg-error "ambiguous reference" }
67 end subroutine his_fun
69 ! { dg-final { cleanup-modules "test_mod test_mod2" } }