public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41582]  New: Allocation of abstract types requires a type spec or a SOURCE
@ 2009-10-05 12:53 burnus at gcc dot gnu dot org
  2009-10-08 15:39 ` [Bug fortran/41582] " burnus at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-05 12:53 UTC (permalink / raw)
  To: gcc-bugs

type, abstract :: t
  end type t
  class(t), allocatable :: a
  allocate(a)
is wrong. For the allocate one has to use either
  allocate(derived-type :: a)
or
  allocate(a, source=some_type_or_class)

One needs to reject this at compile time.

 * * *

Another interesting issue is:

type, abstract :: t
end type t
class(t), allocatable :: a,b
allocate(a, source=b)
end

That is invalid as "b" is not allocated, i.e. it does not have a dynamic type.
A check could/should be implemented at the same time as PR 41581.


-- 
           Summary: Allocation of abstract types requires a type spec or a
                    SOURCE
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2009-10-09 20:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-05 12:53 [Bug fortran/41582] New: Allocation of abstract types requires a type spec or a SOURCE burnus at gcc dot gnu dot org
2009-10-08 15:39 ` [Bug fortran/41582] " burnus at gcc dot gnu dot org
2009-10-09 20:34 ` burnus at gcc dot gnu dot org
2009-10-09 20:42 ` burnus at gcc dot gnu dot 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).