https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78661

--- Comment #6 from janus at gcc dot gnu.org ---
(In reply to janus from comment #5)
> Btw, this variant is wrongly rejected:
> 
> [..]
> 
>    NAMELIST /nml/ x
>                1
> Error: NAMELIST object ‘x’ in namelist ‘nml’ at (1) is polymorphic and
> requires a defined input/output procedure

Sorry, false alarm. In principle the error message is correct, although the
wording is maybe a bit off: Both an input *and* output procedure is required!

I'd suggest this change:

Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c       (revision 243773)
+++ gcc/fortran/resolve.c       (working copy)
@@ -13871,8 +13871,8 @@ resolve_fl_namelist (gfc_symbol *sym)
       if (nl->sym->ts.type == BT_CLASS && !dtio)
        {
          gfc_error ("NAMELIST object %qs in namelist %qs at %L is "
-                    "polymorphic and requires a defined input/output "
-                    "procedure", nl->sym->name, sym->name, &sym->declared_at);
+                    "polymorphic and requires defined input and output "
+                    "procedures", nl->sym->name, sym->name,
&sym->declared_at);
          return false;
        }

Reply via email to