This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/47024] [OOP] STORAGE_SIZE (for polymorphic types): Segfault at run time


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

--- Comment #2 from janus at gcc dot gnu.org 2010-12-20 15:16:44 UTC ---
(In reply to comment #0)
> STORAGE_SIZE does not work for unallocated polymorphic types. However, the
> Fortran 2008 standard allows them:
> 
> "A    shall be a scalar or array of any type. If it is polymorphic it shall not
>       be an undefined pointer. If it has any deferred type parameters it shall
>       not be an unallocated allocatable variable or a disassociated or
> undefined
>       pointer." (F2008, 13.7.160)


I don't really understand this. Why should one allow it for unallocated
allocatables, but not for undefined pointers?

Also, it's not exactly clear to me which value to expect for such a case. From
the standard's description of STORAGE_SIZE:

"The result value is the size expressed in bits for an element of an array that
has the dynamic type and type parameters of A."

However, if A is unallocated, it does not have a dynamic type!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]