https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104812
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Thu, Mar 10, 2022 at 11:27:41AM +0000, fruitclover at gmail dot com wrote: > > --- Comment #2 from Mike K. <fruitclover at gmail dot com> --- > Thanks, and subroutine s2 conforming Fortran 2018, 19.4, right? > No. The logical variable 'x' is a local entity. You have 'x:i block' where this 'x' is a construct name and conflicts with the local variable. Note, the prohibition in the standard is not a numbered constraint, which means a compiler need not issue an error or warning. It is expected that the programmer writes conforming code. If you actually try to use the variable 'x', you'll get an error. subroutine s2 logical :: x x: block x = .true. end block x if (x) print *,'whoops' end % gfcx -c a.f90 a.f90:4:6: 4 | x = .true. | 1 Error: 'x' at (1) is not a variable a.f90:6:8: 6 | if (x) print *,'whoops' | 1 Error: Symbol at (1) is not appropriate for an expression'