2005-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/25093
* resolve.c (resolve_fntype): Check that PUBLIC functions
aren't of PRIVATE type.
testsuite/
2005-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/25093
* gfortran.dg/private_type_4.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@109474
138bc75d-0d04-0410-961f-
82ee72b054a4
+2005-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ PR fortran/25093
+ * resolve.c (resolve_fntype): Check that PUBLIC functions
+ aren't of PRIVATE type.
+
2005-01-07 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* decl.c (gfc_match_function_decl): Correctly error out in case of
sym->attr.untyped = 1;
}
+ if (sym->ts.type == BT_DERIVED && !sym->ts.derived->attr.use_assoc
+ && !gfc_check_access (sym->ts.derived->attr.access,
+ sym->ts.derived->ns->default_access)
+ && gfc_check_access (sym->attr.access, sym->ns->default_access))
+ {
+ gfc_error ("PUBLIC function '%s' at %L cannot be of PRIVATE type '%s'",
+ sym->name, &sym->declared_at, sym->ts.derived->name);
+ }
+
if (ns->entries)
for (el = ns->entries->next; el; el = el->next)
{
+2005-01-08 Erik Edelmann <eedelman@gcc.gnu.org>
+
+ PR fortran/25093
+ * gfortran.dg/private_type_4.f90: New.
+
2005-01-07 Richard Guenther <rguenther@suse.de>
* gcc.dg/tree-ssa/loop-15.c: Use optimized dump.
--- /dev/null
+! { 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