diff mbox

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

Message ID CAKwh3qiXjF2wqiTb-p2qLiOjUe_vwS97k+ef_T-9Vw69pudtWg@mail.gmail.com
State New
Headers show

Commit Message

Janus Weil Nov. 9, 2016, 5:35 p.m. UTC
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
diff mbox

Patch

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);