| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-std=f95" } |
| 3 |
! |
| 4 |
! PR fortran/39427 |
| 5 |
! |
| 6 |
! Check constructor functionality. |
| 7 |
! |
| 8 |
! |
| 9 |
module 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 |
| 16 |
contains |
| 17 |
function f() ! { dg-error "the same name as derived type" } |
| 18 |
type(t) :: f |
| 19 |
end function |
| 20 |
end module |
| 21 |
|
| 22 |
module 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 |
| 29 |
contains |
| 30 |
function f2() ! { dg-error "the same name as derived type" } |
| 31 |
type(t2) :: f2 |
| 32 |
end function |
| 33 |
end module |