[Patch, Fortran, committed] PR 60777: [F03] RECURSIVE function rejected in specification expression

Janus Weil janus@gcc.gnu.org
Wed Nov 9 17:35:00 GMT 2016


Hi all,

I just committed a close-to-obvious fix for PR60777 (ok'd by Steve in
the PR), see attachment:

https://gcc.gnu.org/viewcvs?rev=242009&root=gcc&view=rev

Cheers,
Janus
-------------- next part --------------
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c	(Revision 241993)
+++ gcc/fortran/expr.c	(Arbeitskopie)
@@ -2794,12 +2794,12 @@ external_spec_function (gfc_expr *e)
       return false;
     }
 
-  if (f->attr.recursive)
-    {
-      gfc_error ("Specification function %qs at %L cannot be RECURSIVE",
-		 f->name, &e->where);
+  /* F08:7.1.11.6. */
+  if (f->attr.recursive
+      && !gfc_notify_std (GFC_STD_F2003,
+			  "Specification function '%s' "
+			  "at %L cannot be RECURSIVE",  f->name, &e->where))
       return false;
-    }
 
 function_allowed:
   return restricted_args (e->value.function.actual);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spec_expr_7.f90
Type: text/x-fortran
Size: 706 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161109/8eab305d/attachment.bin>


More information about the Gcc-patches mailing list