This is the mail archive of the gcc-patches@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] |
What is still missing is a check if the type in the ALLOCATE stmt is compatible with the type of the allocate-object (i.e. C624, see my test case).
Which type? For the intrinsic types, the checking of compatibility was in my original type.Yeah, sure. This is about derived types, where you have two possibilities AFAICS: 1) If the object which is being allocated was declared with TYPE, the ALLOCATE statement must have the same type (or omit it). 2) If the object which was declared with CLASS, the ALLOCATE statement may have any type which is a descendant of the original type.
Btw: Do we have a function which checks if one type is an extension (direct or indirect) of another, or do I have to invent this?
Ok, I have implemented this now (updated patch attached).
+ while (t0 != t && t->attr.extension) + t = t->components->ts.u.derived;
I think you can just do t = gfc_get_super_type (t); instead -- this seems much more understandable to me.
Cheers, Daniel
-- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |