re PR fortran/87734 (ICE in is_illegal_recursion check for character len= parameter)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 10 Mar 2019 09:34:46 +0000 (09:34 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 10 Mar 2019 09:34:46 +0000 (09:34 +0000)
2019-03-10  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-10  Thomas Koenig  <tkoenig@gcc.gnu.org>

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

From-SVN: r269547

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

index 785c7313eda3cb3f08e52b0493ff46bf0f227ba0..d8f5abb1c5d9326b2296d36f46f4be481bd2da8c 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-10  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/71544
index 0eb413084d14bd4561966a893ffec0f438d77646..4dfa836dddf43b9b5ec46f74185a3d86d9b6a450 100644 (file)
@@ -1805,7 +1805,8 @@ gfc_add_procedure (symbol_attribute *attr, procedure_type t,
   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))
index 917d1719f7122ed8cf07906bd0beab268117cc51..05be09941206002fef1449076fea473b258733db 100644 (file)
@@ -1,3 +1,8 @@
+2019-03-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
+
+       PR fortran/87734
+       * gfortran.dg/public_private_module_10.f90: New test.
+
 2019-03-09  John David Anglin  <dave.anglin@bell.net>
 
        PR c++/70349
diff --git a/gcc/testsuite/gfortran.dg/public_private_module_10.f90 b/gcc/testsuite/gfortran.dg/public_private_module_10.f90
new file mode 100644 (file)
index 0000000..ddc1f88
--- /dev/null
@@ -0,0 +1,16 @@
+! PR 87734
+module m_vstring
+  implicit none
+
+  public :: vstring_length
+
+contains
+
+  subroutine vstring_cast()
+    character ( len = vstring_length() ) :: char_string
+  end subroutine
+
+  pure integer function vstring_length ()
+  end function
+
+end module