public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/105501] New: The statement TYPE IS without a space is accepted
@ 2022-05-06  7:31 chilikin.k at gmail dot com
  2022-05-06 20:34 ` [Bug fortran/105501] " anlauf at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: chilikin.k at gmail dot com @ 2022-05-06  7:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105501
           Summary: The statement TYPE IS without a space is accepted
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chilikin.k at gmail dot com
  Target Milestone: ---

The following module

MODULE M
  TYPE T
    INTEGER I
  END TYPE
CONTAINS
  SUBROUTINE S(X)
    CLASS(T), POINTER :: X
    SELECT TYPE (X)
      TYPEIS (T)
        PRINT *, 'T'
    END SELECT
  END SUBROUTINE
END MODULE

compiles without any messages with gfortran 11.3.0:

$ gfortran -c -std=f2018 -pedantic test.f90

(there are no warnings)

However, "TYPEIS" requires one or more blank characters between "TYPE" and "IS"
in accordance with the section "Blank characters in free form" of the standard
as it is not included in the list of exceptions with optional blanks.

For comparison, the output of flang 14.0.3 is:

$ flang -c -std=f2018 test.f90
test.f90:9:12: missing space
        TYPEIS (T)
             ^
test.f90:9:7: in the context: type guard statement
        TYPEIS (T)
        ^
test.f90:8:5: in the context: SELECT TYPE construct
      SELECT TYPE (X)
      ^
test.f90:8:5: in the context: execution part construct
      SELECT TYPE (X)
      ^
test.f90:8:5: in the context: execution part
      SELECT TYPE (X)
      ^
test.f90:6:3: in the context: SUBROUTINE subprogram
    SUBROUTINE S(X)
    ^
test.f90:5:1: in the context: module subprogram part
  CONTAINS
  ^
test.f90:1:1: in the context: module
  MODULE M
  ^

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-05-09 19:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06  7:31 [Bug fortran/105501] New: The statement TYPE IS without a space is accepted chilikin.k at gmail dot com
2022-05-06 20:34 ` [Bug fortran/105501] " anlauf at gcc dot gnu.org
2022-05-06 20:51 ` anlauf at gcc dot gnu.org
2022-05-08 20:18 ` anlauf at gcc dot gnu.org
2022-05-09 19:36 ` cvs-commit at gcc dot gnu.org
2022-05-09 19:38 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).