1! { dg-do compile }
2! One of the tests of the patch for PR30068.
3! Taken from comp.lang.fortran 3rd December 2006.
4!
5! Although the generic procedure is not referenced and it would
6! normally be permissible for it to be ambiguous, the USE, ONLY
7! statement is effectively a reference and is invalid.
8!
9module mod1
10   interface generic
11      subroutine foo(a)
12         real :: a
13      end subroutine
14   end interface generic
15end module  mod1
16
17module mod2
18   interface generic
19      subroutine bar(a)
20         real :: a
21      end subroutine
22   end interface generic
23end module  mod2
24
25program main
26  use mod1, only: generic   ! { dg-warning "has ambiguous interfaces" }
27  use mod2
28end program main
29