This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41582] New: Allocation of abstract types requires a type spec or a SOURCE
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Oct 2009 12:53:03 -0000
- Subject: [Bug fortran/41582] New: Allocation of abstract types requires a type spec or a SOURCE
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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