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

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-15
                 CC|                            |janus at gcc dot gnu.org
            Summary|ICE with TYPE, EXTENDS      |[F03] ICE with TYPE,
                   |before parent TYPE defined  |EXTENDS before parent TYPE
                   |                            |defined
     Ever confirmed|0                           |1

--- Comment #1 from janus at gcc dot gnu.org ---
Confirmed with 4.7, 4.8 and trunk. Slightly reduced test case:


module ct
  public :: t1

  type, extends(t1) :: t2
  end type

  type :: t1
  end type
end


It seems to be invalid according to C428 in F08:

R427 type-attr-spec is ABSTRACT
                    or access-spec
                    or BIND (C)
                    or EXTENDS ( parent-type-name )

C428 (R427) A parent-type-name shall be the name of a previously defined
extensible type (4.5.7).


Btw, leaving out the PUBLIC statement, one gets this error:

  type, extends(t1) :: t2
                   1
Error: No such symbol in TYPE definition at (1)


... which is in principle correct, but a bit ill-worded.


Both variants should be rejected with the same (improved) wording.

Reply via email to