This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50555] synonymous namelist/statement function dummy argument not allowed (r178939)
- From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Jan 2016 06:06:19 +0000
- Subject: [Bug fortran/50555] synonymous namelist/statement function dummy argument not allowed (r178939)
- Auto-submitted: auto-generated
- References: <bug-50555-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50555
--- Comment #6 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
This patch:
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 64d59cee..8a465db6 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -14275,6 +14275,13 @@ resolve_symbol (gfc_symbol *sym)
if (sym->ns != formal->sym->ns)
sym->formal_ns->refs++;
}
+
+ /* Check that none of the arguments are a namelist.. */
+ for (formal = sym->formal; formal; formal = formal->next)
+ if (formal->sym && formal->sym->attr.flavor == FL_NAMELIST)
+ gfc_error ("Namelist '%s' as argument to procedure at %L "
+ "not allowed.", formal->sym->name,
+ &sym->declared_at);
}
/* Check threadprivate restrictions. */
results in:
$ gfc pr50555.f90
pr50555.f90:3:7:
f(i)=0
1
Error: Namelist 'i' as argument to procedure at (1) not allowed.