[Patch,Fortran] PR41582 allocate patch for CLASS

Tobias Burnus burnus@net-b.de
Fri Oct 9 17:16:00 GMT 2009


this patch implements

a) A constraint for ALLOCATE (class with abstract base type):
"C625 (R623) If any allocate-object is unlimited polymorphic or
 is of abstract type, either type-spec or SOURCE= shall appear."

(If you miss "abstract type" in your copy of the standard, you
 do not have read Corrigendum 1.)

b) Reject "allocate(..., SOURCE=<class>)". To make it work, one
needs to know the size at run time, which does not work yet. I
think it makes sense to reject it rather than to use the size of
the base type and only to warn about it.
(This is probably the most important missing feature in gfortran's
 OOP implementation.)

Build and regtested on x86-64-linux.
OK for the trunk?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: class-diag.diff
Type: text/x-patch
Size: 5401 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091009/db9ebbaf/attachment.bin>

More information about the Gcc-patches mailing list