diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2017-03-25 17:38:17 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2017-03-25 17:38:17 +0000 |
commit | 410366864025c2aa6ce1928d1737bc9cc4f752e6 (patch) | |
tree | 38bf17a45d44082c070cf7f7752af91231314254 /gcc/fortran/decl.c | |
parent | 59ba44930fb9d8c1e1c6c3b6de9be7ab77933284 (diff) | |
download | gcc-410366864025c2aa6ce1928d1737bc9cc4f752e6.zip gcc-410366864025c2aa6ce1928d1737bc9cc4f752e6.tar.gz gcc-410366864025c2aa6ce1928d1737bc9cc4f752e6.tar.bz2 |
re PR fortran/80156 (Generic DTIO interface reported missing if public statement preceeds the interface block)
2017-03-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80156
PR fortran/79382
* decl.c (access_attr_decl): Remove the error for an absent
generic DTIO interface and ensure that symbol has the flavor
FL_PROCEDURE.
2017-03-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/80156
PR fortran/79382
* gfortran.dg/dtio_23.f90 : Remove the dg-error and add the
testcase for PR80156. Add a main programme that tests that
the typebound generic is accessible.
From-SVN: r246476
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index a04f5a6..5ca664e 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -7570,23 +7570,15 @@ access_attr_decl (gfc_statement st) case INTERFACE_GENERIC: case INTERFACE_DTIO: - if (type == INTERFACE_DTIO - && gfc_current_ns->proc_name - && gfc_current_ns->proc_name->attr.flavor == FL_MODULE) - { - gfc_find_symbol (name, gfc_current_ns, 0, &sym); - if (sym == NULL) - { - gfc_error ("The GENERIC DTIO INTERFACE at %C is not " - "present in the MODULE %qs", - gfc_current_ns->proc_name->name); - return MATCH_ERROR; - } - } - if (gfc_get_symbol (name, NULL, &sym)) goto done; + if (type == INTERFACE_DTIO + && gfc_current_ns->proc_name + && gfc_current_ns->proc_name->attr.flavor == FL_MODULE + && sym->attr.flavor == FL_UNKNOWN) + sym->attr.flavor = FL_PROCEDURE; + if (!gfc_add_access (&sym->attr, (st == ST_PUBLIC) ? ACCESS_PUBLIC : ACCESS_PRIVATE, |