summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/private_type_4.f90
blob: 42303ca53cca1334489052634e8b04ac743588b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! { dg-do compile }
! { dg-options "-std=f95" }
! PR 25093: Check that a PUBLIC function can't be of PRIVATE type
! in Fortran 95; in Fortran 2003 it is allowed (cf. PR fortran/38065)
!
module m1

    type :: t1
        integer :: i
    end type t1

    private :: t1
    public :: f1

contains

    type(t1) function f1() ! { dg-error "of PRIVATE derived type" }
    end function

end module

! { dg-final { cleanup-modules "m1" } }