This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57966] [OOP] Using a TBP to specify the shape of a dummy argument
- 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, 24 Jul 2013 12:17:51 +0000
- Subject: [Bug fortran/57966] [OOP] Using a TBP to specify the shape of a dummy argument
- Auto-submitted: auto-generated
- References: <bug-57966-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57966
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |janus at gcc dot gnu.org
--- Comment #2 from janus at gcc dot gnu.org ---
Draft patch (not regtested yet):
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 201038)
+++ gcc/fortran/resolve.c (working copy)
@@ -5638,14 +5638,6 @@ resolve_compcall (gfc_expr* e, const char **name)
gfc_actual_arglist* newactual;
gfc_symtree* target;
- /* Check that's really a FUNCTION. */
- if (!e->value.compcall.tbp->function)
- {
- gfc_error ("'%s' at %L should be a FUNCTION",
- e->value.compcall.name, &e->where);
- return false;
- }
-
/* These must not be assign-calls! */
gcc_assert (!e->value.compcall.assign);
@@ -5661,6 +5653,15 @@ resolve_compcall (gfc_expr* e, const char **name)
return false;
gcc_assert (!e->value.compcall.tbp->is_generic);
+ /* Check that it's really a FUNCTION. */
+ if (!e->value.compcall.tbp->function
+ && !e->value.compcall.tbp->u.specific->n.sym->attr.function)
+ {
+ gfc_error ("'%s' at %L should be a FUNCTION",
+ e->value.compcall.name, &e->where);
+ return false;
+ }
+
/* Take the rank from the function's symbol. */
if (e->value.compcall.tbp->u.specific->n.sym->as)
e->rank = e->value.compcall.tbp->u.specific->n.sym->as->rank;