diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/private_type_4.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/private_type_4.f90 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/private_type_4.f90 b/gcc/testsuite/gfortran.dg/private_type_4.f90 new file mode 100644 index 00000000000..a5b5578c45a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/private_type_4.f90 @@ -0,0 +1,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 |