http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50556
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
CC| |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-29
14:47:52 UTC ---
> One might argue that a "SAVE namelist-group-name" should mean that all
> namelist-group-objects associate this namelist-group-name gets the SAVE
> attribute. If this interpretation was correct, then one would expect that
> text in the Standard would make this clear.
Well, I see in the standard:
"C553 An entity with the SAVE attribute shall be a common block, variable, or
procedure pointer."
And I would argue that a namelist-group-name is neither a common block, a
variable nor a procedure pointer.
Thus, I believe that the code in comment 0 is invalid.
Regarding the patch in comment 1: I think it will not work if one swaps the
order of NAMELIST and SAVE.
Untested patch:
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -441,6 +441,7 @@ check_conflict (symbol_attribute *attr, const char *name,
locus *where)
case FL_LABEL:
case FL_DERIVED:
case FL_PARAMETER:
+ case FL_NAMELIST:
a1 = gfc_code2string (flavors, attr->flavor);
a2 = save;
goto conflict;
@@ -449,7 +450,6 @@ check_conflict (symbol_attribute *attr, const char *name,
locus *where)
/* Conflicts between SAVE and PROCEDURE will be checked at
resolution stage, see "resolve_fl_procedure". */
case FL_VARIABLE:
- case FL_NAMELIST:
default:
break;
}