re PR fortran/78741 (ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1534)
[official-gcc.git] / gcc / testsuite / gfortran.dg / private_type_4.f90
blob95b8fe304172d99e7e47057479124350441231ef
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
3 ! PR 25093: Check that a PUBLIC function can't be of PRIVATE type
4 ! in Fortran 95; in Fortran 2003 it is allowed (cf. PR fortran/38065)
6 module m1
8 type :: t1
9 integer :: i
10 end type t1
12 private :: t1
13 public :: f1
15 contains
17 type(t1) function f1() ! { dg-error "of PRIVATE derived type" }
18 end function
20 end module