This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
2010/6/13 Tobias Burnus <burnus@net-b.de>:
> Janus Weil wrote:
>>>> * MOLD= and default initializer: As Janus has correctly stated, MOLD
>>>> implies that the default initializer is used. If one searches for the
>>>> proposal email at J3, this is explicitly stated there. I think the patch
>>>> does not handle this for CLASS - please note this in the PR.
>>>>
>>> I believe that this is handled in the patch:
>>>
>>> + ? ? ?else if (e->ts.type == BT_CLASS)
>>> + ? ? ? init_e = gfc_default_initializer (&ts.u.derived->components->ts);
>>>
>> Right.
>>
>
> But doesn't this use the base type for initialization while the
> effective type should be used?
Yes, this is the issue I was talking about in my original post. My
proposal was to extend the vtab structure to hold the default
initialization. What do you think about this?
>>>> * The constraint C637 (cf. above) does not seem to be checked for.
>>>>
>>> Yes, I think you're right that C637 prohibits MOLD and SOURCE
>>> from appearing in the same statement. ?I was looking for a
>>> constraint the explicitly made this statement.
>>>
>> I think the way in which C637 talks about "source-expr" is slightly
>> ambiguous, and I read it such that SOURCE and MOLD would be allowed
>> together, but neither of them together with type-spec.
>>
>
> Re-reading I agree that that's a possible reading, though I think my
> reading is more likely;
Unfortunately I don't have access to any other compiler supporting
this feature (is there any?). Can someone check if NAG supports MOLD
and if yes if it allows SOURCE together with MOLD?
> also technically as it avoids the precedence
> ambiguity of having MOLD and SOURCE in the same statement
What precedence ambiguity? I don't see any.
> and I do not
> see a case where it makes sense and would more in more than a very
> constructed example.
One might interpret the situation as taking the dynamic type from MOLD
and the data init from SOURCE. Although I'm not sure how useful that
is as a feature ...
Cheers,
Janus
- References:
- [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=
- Re: [Patch, Fortran, OOP] PR 43388: [F2008] ALLOCATE with MOLD=