public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/56459] New: Wrongly rejects "TYPE(CHARACTER*1,)"  (with comma)
@ 2013-02-26 14:21 burnus at gcc dot gnu.org
  2013-02-27 13:55 ` [Bug fortran/56459] " burnus at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-02-26 14:21 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56459

             Bug #: 56459
           Summary: Wrongly rejects "TYPE(CHARACTER*1,)"  (with comma)
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


On c.l.f., Ian Harvey pointed out that the Fortran 2008 standard allows the
following. Note the ",".

Cf. https://groups.google.com/d/topic/comp.lang.fortran/W2hWVhtHmlM/discussion
and http://mailman.j3-fortran.org/pipermail/j3/2013-February/006159.html


TYPE(CHARACTER*1)     C0 ! Accepted
TYPE(CHARACTER*1,)    C1 ! Wrongly rejected
TYPE(CHARACTER*1,) :: C2 ! Wrongly rejected
end


gfortran rejects it with Error: Unclassifiable statement


>From Fortran 2008:

R402  type-spec  is  intrinsic-type-spec
                 or  derived-type-spec

R403  declaration-type-spec  is  intrinsic-type-spec
                             or  TYPE ( intrinsic-type-spec )
                             or  TYPE ( derived-type-spec )
                             or  CLASS ( derived-type-spec )
                             or  CLASS ( * )

R404  intrinsic-type-spec  is  INTEGER [ kind-selector ]
                           or  REAL [ kind-selector ]
                           or  DOUBLE PRECISION
                           or  COMPLEX [ kind-selector ]
                           or  CHARACTER [ char-selector ]
                           or  LOGICAL [ kind-selector ]

R420  char-selector  is  length-selector
                     or ...

R421 length-selector  is  ( [ LEN = ] type-param-value )
                      or  * char-length [ , ]


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

* [Bug fortran/56459] Wrongly rejects "TYPE(CHARACTER*1,)"  (with comma)
  2013-02-26 14:21 [Bug fortran/56459] New: Wrongly rejects "TYPE(CHARACTER*1,)" (with comma) burnus at gcc dot gnu.org
@ 2013-02-27 13:55 ` burnus at gcc dot gnu.org
  2014-12-16  4:01 ` ian_harvey at bigpond dot com
  2014-12-16  8:52 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-02-27 13:55 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56459

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-27 13:54:37 UTC ---
Note: This might get fixed via an interpretation request, cf.
http://mailman.j3-fortran.org/pipermail/j3/2013-February/006161.html


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

* [Bug fortran/56459] Wrongly rejects "TYPE(CHARACTER*1,)"  (with comma)
  2013-02-26 14:21 [Bug fortran/56459] New: Wrongly rejects "TYPE(CHARACTER*1,)" (with comma) burnus at gcc dot gnu.org
  2013-02-27 13:55 ` [Bug fortran/56459] " burnus at gcc dot gnu.org
@ 2014-12-16  4:01 ` ian_harvey at bigpond dot com
  2014-12-16  8:52 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: ian_harvey at bigpond dot com @ 2014-12-16  4:01 UTC (permalink / raw)
  To: gcc-bugs

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

Ian Harvey <ian_harvey at bigpond dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian_harvey at bigpond dot com

--- Comment #2 from Ian Harvey <ian_harvey at bigpond dot com> ---
As a result of interp f08/0097, F2008 corrigendum three introduced constraint
C406a ("In TYPE(intrinsic-type-spec) the intrinsic-type-spec shall not end with
a comma") that makes the original example non-conforming.

It is therefore now correct (and sensible) for the compiler to reject the
example.


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

* [Bug fortran/56459] Wrongly rejects "TYPE(CHARACTER*1,)"  (with comma)
  2013-02-26 14:21 [Bug fortran/56459] New: Wrongly rejects "TYPE(CHARACTER*1,)" (with comma) burnus at gcc dot gnu.org
  2013-02-27 13:55 ` [Bug fortran/56459] " burnus at gcc dot gnu.org
  2014-12-16  4:01 ` ian_harvey at bigpond dot com
@ 2014-12-16  8:52 ` burnus at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: burnus at gcc dot gnu.org @ 2014-12-16  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Closed as WONTFIX


For the IR, see http://j3-fortran.org/doc/year/14/14-006A.txt:
----------------------------------------------------------------
NUMBER: F08/0097
TITLE: Is the optional comma allowed in TYPE(CHARACTER*...)?
KEYWORD: TYPE, CHARACTER
DEFECT TYPE: Erratum
STATUS: In F2008 Corrigendum 3

QUESTION:

Consider

  CHARACTER*1, A
  TYPE(CHARACTER*1,) B

The optional comma in the declaration of B looks ugly.
Is this deliberate?

ANSWER:

No, this syntax was inadvertently allowed.  An edit is provided to
remove it.

EDITS to 10-007r1:

[51:26+] 4.3.1.1, after C406, insert new constraint
  "C406a (R403) In TYPE(<intrinsic-type-spec>) the
         <intrinsic-type-spec> shall not end with a comma."

SUBMITTED BY: Malcolm Cohen

HISTORY: 13-285    m201  F08/0097 submitted - passed by J3 meeting
         13-313    m202  Passed by J3 letter ballot 13-297
         N1994     m202  Passed by WG5 ballot 7 N1991/92/94
         N2002     m203  In F2008 Corrigendum 3


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

end of thread, other threads:[~2014-12-16  8:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 14:21 [Bug fortran/56459] New: Wrongly rejects "TYPE(CHARACTER*1,)" (with comma) burnus at gcc dot gnu.org
2013-02-27 13:55 ` [Bug fortran/56459] " burnus at gcc dot gnu.org
2014-12-16  4:01 ` ian_harvey at bigpond dot com
2014-12-16  8:52 ` burnus 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).