The Fortran standard disallows use associated names as namelist group name
(e.g. F2003:C581, but also later standards). This feature is a gfortran
legacy extension, and we should give a warning even for -std=gnu.
gcc/fortran/ChangeLog:
* match.cc (gfc_match_namelist): Downgrade feature from GNU to
legacy extension.
gcc/testsuite/ChangeLog:
* gfortran.dg/pr88169_3.f90: Adjust pattern.
return MATCH_ERROR;
}
+ /* A use associated name shall not be used as a namelist group name
+ (e.g. F2003:C581). It is only supported as a legacy extension. */
if (group_name->attr.flavor == FL_NAMELIST
&& group_name->attr.use_assoc
- && !gfc_notify_std (GFC_STD_GNU, "Namelist group name %qs "
+ && !gfc_notify_std (GFC_STD_LEGACY, "Namelist group name %qs "
"at %C already is USE associated and can"
"not be respecified.", group_name->name))
return MATCH_ERROR;
use foo_nml, only: bar => foo, x
implicit none
real a
- namelist /bar/a ! { dg-error "already is USE associated" }
+ namelist /bar/a ! { dg-error "Legacy Extension: .* already is USE associated" }
end program
-! { dg-final { cleanup-modules "foo_nml" } }