Hello world,
I have attached the patch below as obvious and simple (it is a
one-liner). The problem was a latent bug exposed by my recent
commit for PR 78865, where the check for subroutine entries
was done on the main symbol instead of the entry. Provision
for doing this for the entry master were already in place,
I simply added the condition for the entry itself.
I will wait a week or so before committing to gcc-8, the only
other affected branch.
Regards
Thomas
2019-04-06 Thomas Koenig <[email protected]>
PR fortran/89981
* resolve.c (resolve_global_procedure): If the global symbol is an
ENTRY, also look up its name among the entries.
2019-04-06 Thomas Koenig <[email protected]>
PR fortran/89981
* gfortran.dg/entry_22.f90: New test.
Index: resolve.c
===================================================================
--- resolve.c (Revision 269895)
+++ resolve.c (Arbeitskopie)
@@ -2546,7 +2546,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *
if (gsym->binding_label && gsym->sym_name != def_sym->name)
gfc_find_symbol (gsym->sym_name, gsym->ns, 0, &def_sym);
- if (def_sym->attr.entry_master)
+ if (def_sym->attr.entry_master || def_sym->attr.entry)
{
gfc_entry_list *entry;
for (entry = gsym->ns->entries; entry; entry = entry->next)
! { dg-do compile }
! { dg-additional-options "-pedantic" }
! PR fortran/89981 - this used to give a wrong warning (error with
! -pedantic)
program main
call bar(i)
call baz(i) ! { dg-error "Type mismatch in argument" }
end program main
subroutine foo(r)
entry bar(i)
entry baz(r)
end subroutine foo