1! { dg-do compile }
2! Tests the fix for PR37794 a regression where a bit of redundant code caused an ICE.
3!
4! Contributed by Jonathan Hogg  <J.Hogg@rl.ac.uk>
5!
6module m1
7  implicit none
8
9  type of01_data_private
10    real :: foo
11  end type of01_data_private
12
13  type of01_data
14    type (of01_data_private) :: private
15  end type of01_data
16end module m1
17
18module m2
19  implicit none
20
21  type of01_data_private
22    integer :: youngest
23  end type of01_data_private
24end module m2
25
26module test_mod
27  use m1, of01_rdata => of01_data
28  use m2, of01_idata => of01_data ! { dg-error "not found in module" }
29
30  implicit none
31end module test_mod
32