I've committed the attached patch as obvious.

2019-01-09  Steven G. Kargl  <ka...@gcc.gnu.org>

 PR fortran/88376
 * resolve.c (is_illegal_recursion): Remove an assert().

2019-01-09  Steven G. Kargl  <ka...@gcc.gnu.org>

 PR fortran/88376
 * gfortran.dg/pr88376.f90: New test.

-- 
Steve
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c	(revision 267779)
+++ gcc/fortran/resolve.c	(working copy)
@@ -1686,8 +1686,6 @@ is_illegal_recursion (gfc_symbol* sym, gfc_namespace* 
       || gfc_fl_struct (sym->attr.flavor))
     return false;
 
-  gcc_assert (sym->attr.flavor == FL_PROCEDURE);
-
   /* If we've got an ENTRY, find real procedure.  */
   if (sym->attr.entry && sym->ns->entries)
     proc_sym = sym->ns->entries->sym;
Index: gcc/testsuite/gfortran.dg/pr88376.f90
===================================================================
--- gcc/testsuite/gfortran.dg/pr88376.f90	(nonexistent)
+++ gcc/testsuite/gfortran.dg/pr88376.f90	(working copy)
@@ -0,0 +1,8 @@
+! { dg-do compile }
+module m
+   integer :: n
+contains
+   subroutine s
+      character(n(3)) :: c  ! { dg-error "not a function" }
+   end
+end

Reply via email to