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

            Bug ID: 90290
           Summary: -std=f2008 should reject non-constant stop and error
                    stop codes
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thenlich+gccbug at gmail dot com
  Target Milestone: ---

According to Fortran 2008, a stop-code in a stop-stmt or error-stop-stmt must
be either scalar-default-char-constant-expr or scalar-int-constant-expr
(Fortran 2018: scalar-default-char-expr or scalar-int-expr)

The following:
====
program errorstop
  integer :: ec
  read *, ec
  stop ec
end program
====

compiles successfully with -std=f2008.

It should not: while the program is Fortran 2018 compliant, it is not Fortran
2008 compliant.

Reply via email to