Mikael Morin wrote:
Le 26.07.2010 22:32, Tobias Burnus a écrit :
Build and and currently regtesting on x86-64-linux. If there is no
failure:
OK for the trunk?
The extra expr.c hunk (pr45081 fix) which slipped through, is ok (and
obvious).
But regresses in terms of diagnostics - I will leave it out and have a
separate look later.
For the interface thing see below. /* F2003, 12.3.1.1 (3b);
F2008, 12.4.2.2 (3b) */
- if (def_sym->result->attr.pointer
- || def_sym->result->attr.allocatable)
+ if ((def_sym->result->attr.pointer
+ || def_sym->result->attr.allocatable)
+&& (sym->attr.if_source != IFSRC_IFBODY
The above makes sense, but the 4 following lines are odd.
If I understand it correctly if there is a function
definition/interface mismatch (between pointer or allocatable
attributes), we generate an error asking for explicit interface (even
if the symbol comes from an interface block which _is_ an explicit
interface).
Well, maybe it's better than nothing after all.
That was my idea - I think interface mismatches are rare enough that one
does not need to replicate all the messages - and the error might be
slightly odd, but should give a good hint.
+ || def_sym->result->attr.pointer
+ != sym->result->attr.pointer)
There is an extra parenthesis here
I concur.
+ || (def_sym->result->attr.allocatable
And another one here
I concur. With those changes - which I spotted after I had send the
email (but did not want to send a reply before testing finished),
regtesting succeeded.
&& def_sym->ts.u.cl->length != NULL)
{
gfc_charlen *cl = sym->ts.u.cl;
@@ -1992,14 +1998,14 @@ resolve_global_procedure (gfc_symbol *sy
}
/* F2003, 12.3.1.1 (4); F2008, 12.4.2.2 (4) */
- if (def_sym->attr.elemental)
+ if (def_sym->attr.elemental&& !sym->attr.elemental)
Same as above, I would put
if (def_sym->attr.elemental&& sym->attr.if_source != IFSRC_IFBODY)
like in the previous cases.
It is odd to guess interface explicitness out of symbol elementalness.
Well, I want to print also an error if the INTERFACE has no ELEMENTAL -
I could split the message in one for IFSRC_IFBODY and one for wrong
interfaces, if you think it makes sense.