diff mbox series

[fortran] Fix PR 87734, rejects-valid

Message ID 40221048-5730-74bf-5301-738fff8d8373@netcologne.de
State New
Headers show
Series [fortran] Fix PR 87734, rejects-valid | expand

Commit Message

Thomas Koenig March 9, 2019, 8:57 p.m. UTC
Hello world,

a recent patch by Steve for PR 88376 fixed an ICE in the test case
for PR 87734, leading further down the path to a rejects-valid bug
in the same test case.  Such is progress :-)

This patch fixes that particular error by not treating module procedures
which have been declared PUBLIC or PRIVATE as simple external
procedures.

This is a 7/8/9 regression, backporting may also include backporting
Steve's patch for PR 88376 (I haven't checked yet).

OK for trunk and the other open branches?

Regards

	Thomas

2019-03-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/87734
         * symbol.c (gfc_add_procedure): Only throw an error if the
         procedure has not been declared either PUBLIC or PRIVATE.

2019-03-09  Thomas Koenig  <tkoenig@gcc.gnu.org>

         PR fortran/87734
         * gfortran.dg/public_private_module_10.f90: New test.

Comments

Steve Kargl March 9, 2019, 9:27 p.m. UTC | #1
On Sat, Mar 09, 2019 at 09:57:52PM +0100, Thomas Koenig wrote:
> 
> a recent patch by Steve for PR 88376 fixed an ICE in the test case
> for PR 87734, leading further down the path to a rejects-valid bug
> in the same test case.  Such is progress :-)
> 
> This patch fixes that particular error by not treating module procedures
> which have been declared PUBLIC or PRIVATE as simple external
> procedures.
> 
> This is a 7/8/9 regression, backporting may also include backporting
> Steve's patch for PR 88376 (I haven't checked yet).
> 
> OK for trunk and the other open branches?
> 

OK.
diff mbox series

Patch

Index: symbol.c
===================================================================
--- symbol.c	(Revision 269524)
+++ symbol.c	(Arbeitskopie)
@@ -1805,7 +1805,8 @@  gfc_add_procedure (symbol_attribute *attr, procedu
   if (where == NULL)
     where = &gfc_current_locus;
 
-  if (attr->proc != PROC_UNKNOWN && !attr->module_procedure)
+  if (attr->proc != PROC_UNKNOWN && !attr->module_procedure
+      && attr->access == ACCESS_UNKNOWN)
     {
       if (attr->proc == PROC_ST_FUNCTION && t == PROC_INTERNAL
 	  && !gfc_notification_std (GFC_STD_F2008))