This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/50555] synonymous namelist/statement function dummy argument not allowed (r178939)


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]