This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/46952] [OOP] Spurious "recursive call" error with type bound procedure


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46952

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |janus at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from janus at gcc dot gnu.org 2013-01-10 11:48:54 UTC ---
I think the following patch makes sense:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c    (revision 194927)
+++ gcc/fortran/resolve.c    (working copy)
@@ -3803,7 +3803,7 @@ resolve_call (gfc_code *c)

   /* Subroutines without the RECURSIVE attribution are not allowed to
    * call themselves.  */
-  if (csym && is_illegal_recursion (csym, gfc_current_ns))
+  if (!c->expr1 && csym && is_illegal_recursion (csym, gfc_current_ns))
     {
       if (csym->attr.entry && csym->ns->entries)
     gfc_error ("ENTRY '%s' at %L cannot be called recursively, as"


This is the same workaround that we use in resolve_call for deferred TBPs with
abstract interfaces.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]