Commit 3bcc018c by Erik Edelmann

re PR fortran/25093 (PUBLIC function of PRIVATE type)

fortran/
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.

From-SVN: r109474
parent cf1e0371
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
......
......@@ -5626,6 +5626,15 @@ resolve_fntype (gfc_namespace * ns)
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.
! { 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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment