[Patch, Fortran] PR 41177: Some corrections on base-object checks with type-bound procedures.

Daniel Kraft d@domob.eu
Sat Dec 5 08:37:00 GMT 2009


Steven Bosscher wrote:
> Daniel Kraft wrote:
>> Unfortunatly, the POINTER attribute on CLASS dummies gets always set
>> in decl.c:encapsulate_class_symbol; I thus had to introduce a new flag
>> storing the original value in this case for my check -- this is what
>> Janus also suggested. But if someone else can come up with a nicer
>> solution, I'd be happy to implement it.
> 
> Saving the original POINTER attribute is going to confuse things.
> Already after your patch the dumped parse tree doesn't match anymore
> with what was read in. If attr.pointer is set, then the, well, thing
> declared should have attribute POINTER, otherwise you're basically
> overloading the meaning of this bit.
> 
> Can you not somehow re-engineer things to set your new flag
> attr.class_pointer instead of attr.pointer?
> 
> Or actually, is this still an issue at all? Setting the POINTER
> attribute is not done in encapsulate_class_symbol -- this function
> doesn't even exist anymore. According to the ChangeLog:

This code was moved to symbol.c:gfc_build_class_symbol, but my latest 
patch and ChangeLog should reflect this.  However, it's not me that 
changes the POINTER attribute -- this is already done in the code to 
something like

c.attr->pointer = c.attr->pointer || c.attr->dummy;

and needed -- as Janus told me -- for something in the OOP machinery. 
For my patch I do need the original value though, and Janus/Paul 
suggested to introduce a new flag saving it instead of trying to work 
around while they introduced this pointer-attribute change in the first 
place.

I'm not sure if I got correctly what you mean by "set your new flag 
instead of attr.pointer", but probably this is some misunderstanding at 
all -- I hope I could clear it up to you.  My new patch did regtest and 
also passed Dominique's tests, so I intent to commit it but will give 
you again some time to react here, if you still have any doubts.

Thanks for your input!  Yours,
Daniel

-- 
Done:  Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz
To go: Hea-Kni-Mon-Pri



More information about the Fortran mailing list