1! { dg-do compile }
2! { dg-options "-std=f95" }
3!
4! PR fortran/39427
5!
6! Check constructor functionality.
7!
8!
9module m
10  type t ! { dg-error "the same name as derived type" }
11    integer :: x
12  end type t
13  interface t
14    module procedure f
15  end interface t
16contains
17  function f() ! { dg-error "the same name as derived type" }
18    type(t) :: f
19  end function
20end module
21
22module m2
23  interface t2
24    module procedure f2
25  end interface t2
26  type t2 ! { dg-error "the same name as derived type" }
27    integer :: x2
28  end type t2
29contains
30  function f2() ! { dg-error "the same name as derived type" }
31    type(t2) :: f2
32  end function
33end module
34