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>
8 ! Modified for PR fortran/34657
32 ! This is the original PR, excepting that the error requires the symbol
35 use test_mod
! { dg-error "is also the name of the current program unit" }
37 call my_sub (a
) ! { dg-error "ambiguous reference" }
41 integer function my_fun (a
)
42 use test_mod
! { dg-error "is also the name of the current program unit" }
45 my_fun
= 1 ! { dg-error "ambiguous reference" }
48 ! This was found whilst investigating => segfault
49 subroutine thy_sub (a
)
51 subroutine thy_sub (a
) ! { dg-error "enclosing procedure" }
59 subroutine thy_fun (a
)
61 use test_mod2
! OK because there is no reference to my_fun
63 end subroutine thy_fun
65 subroutine his_fun (a
)
68 print *, my_fun (a
) ! { dg-error "ambiguous reference" }
69 end subroutine his_fun