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) 5! 6module m1 7 8 type :: t1 9 integer :: i 10 end type t1 11 12 private :: t1 13 public :: f1 14 15contains 16 17 type(t1) function f1() ! { dg-error "of PRIVATE derived type" } 18 end function 19 20end module 21