This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/60777] [F03] RECURSIVE function rejected in specification expression
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 Nov 2016 14:56:39 +0000
- Subject: [Bug fortran/60777] [F03] RECURSIVE function rejected in specification expression
- Auto-submitted: auto-generated
- References: <bug-60777-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60777
--- Comment #6 from janus at gcc dot gnu.org ---
I think the patch in comment 1 actually does not work as expected (due to a
spurious semicolon).
However, this variant seems to work well and regtests cleanly:
Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c (revision 241997)
+++ gcc/fortran/expr.c (working copy)
@@ -2794,12 +2794,12 @@
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);
I will commit this soon.