aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/private_type_4.f90
blob: a5b5578c45ae5d5a7bccbeb84abbea8d848da54f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
! { dg-do compile }
! PR 25093: Check that a PUBLIC function can't be of PRIVATE type
module m1

    type :: t1
        integer :: i
    end type t1

    private :: t1
    public :: f1     ! { dg-error "cannot be of PRIVATE type" }

contains

    type(t1) function f1()
    end function

end module