re PR fortran/89981 (gfortran -pedantic rejects code in 8.3.1 that is accepted with...
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 6 Apr 2019 14:16:01 +0000 (14:16 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 6 Apr 2019 14:16:01 +0000 (14:16 +0000)
2019-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>

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  <tkoenig@gcc.gnu.org>

PR fortran/89981
* gfortran.dg/entry_22.f90: New test.

From-SVN: r270182

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/entry_22.f90 [new file with mode: 0644]

index 7b849b0d3fd141617fc2c89e5e52e282abc9402f..ca1728041c31359825881ba6caee9cfc0c698feb 100644 (file)
@@ -1,3 +1,9 @@
+2019-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       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-04  Harald Anlauf  <anlauf@gmx.de>
 
        PR fortran/89004
index 3513a44ede383b3719f0c111a0e97d33cabc7fb9..cb41da08526fcfd76fa0068e7b966456dd39e4ca 100644 (file)
@@ -2546,7 +2546,7 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
          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)
index b854b57507701a402679dbab2b5bc819c663d191..2c8de7a97200755de6f1078c598909c3656f23c5 100644 (file)
@@ -1,3 +1,8 @@
+2019-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/89981
+       * gfortran.dg/entry_22.f90: New test.
+
 2019-04-05  Marek Polacek  <polacek@redhat.com>
 
        PR c++/87145 - bogus error converting class type in template arg list.
diff --git a/gcc/testsuite/gfortran.dg/entry_22.f90 b/gcc/testsuite/gfortran.dg/entry_22.f90
new file mode 100644 (file)
index 0000000..7753429
--- /dev/null
@@ -0,0 +1,12 @@
+! { 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