https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68568
Harald Anlauf <anlauf at gmx dot de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |anlauf at gmx dot de --- Comment #4 from Harald Anlauf <anlauf at gmx dot de> --- (In reply to Gerhard Steinmetz from comment #1) > And this is detected : > (The SAVE attribute shall not be specified for an automatic data object.) > > $ cat z1b.f90 > subroutine s(n) > integer, intent(in) :: n > character(n), save :: x > x = 'a' > end > > $ gfortran -g -O0 -Wall -fcheck=all -c z1b.f90 > z1b.f90:3:26: > > character(n), save :: x > 1 > Error: Automatic object 'x' at (1) cannot have the SAVE attribute This is what is specified in the standard. F2015 working document: C860 The SAVE attribute shall not be specified for a dummy argument, a function result, an automatic data object, or an object that is in a common block. So it's an ICE on valid code.