This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran] PR43366 - add invalid-diagnostic for poly assignment
- From: Janus Weil <janus at gcc dot gnu dot org>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Wed, 18 Sep 2013 15:12:46 +0200
- Subject: Re: [Patch, Fortran] PR43366 - add invalid-diagnostic for poly assignment
- Authentication-results: sourceware.org; auth=none
- References: <5235EC5F dot 2040500 at net-b dot de> <5235F05E dot 8000502 at net-b dot de> <CAKwh3qiXZwsvay4eddL6QwOXng=BmpxDTMVLz7PUnMNV4r=OKA at mail dot gmail dot com> <523943D7 dot 607 at net-b dot de>
> (Side remark: That's Janus' email which didn't make it past GCC's mail
... for whatever reason. I hope this one will make it through.
>>>> Fortran 2008 permits assignment to polymorphic variables with some
>>>> constraints. The patch, which was sitting in my tree, adds diagnostic to
>>>> reject invalid use. For valid code, it runs into the existing
>>>> not-yet-implemented error.
>>>> Build + regtested on x86-64-gnu-linux.
>>>> OK for the trunk?
>> a few comments:
>> 1) How about a test case?
> I added one - and fixed an issue with gfc_expr_attr for codimension.
Ok, thanks. I hadn't noticed the codimension problem.
>> 2) Why not leave in the comment with the F03 reference for now, since
>> you're not modifying that part?
> Well, the F2003 reference is wrong (its about something else).
No, it's not. F03:188.8.131.52 is about intrinsic assignments, just like F08:184.108.40.206.
However, F03:220.127.116.11 is not (maybe this is what you were looking at?).
> That's not
> surprising as assignment to an allocatable polymorphic variable is a Fortran
> 2008 feature. (Reading it as F2008 section number leads one to the intrinsic
> assignment section, which is fine.)
>> 3) You might wanna modify the FIXME note, since your patch addresses
>> at least part of it (namely the invalid-rejection). The only missing
>> item now is to allow the things that are valid in F08, I guess.
> I have now updated the comment - and made the error message clearer.
Ok, looks better to me. After the realloc-on-assign is fully
implemented, one should replace the "not implemented" error by a
gfc_notify_std, of course (where the F03:18.104.22.168 reference would still
> Attached is the updated patch.
> OK for the trunk?
Yes, fine with me. Thanks for the patch.
>> Btw, the patch at http://gcc.gnu.org/ml/fortran/2013-08/msg00026.html
>> was half-approved by Mikael, but is still waiting for your agreement,
>> Tobias, since you had some criticism in the PR ...
> Sorry for the delay. However, it seems as if I have now a bit more time for
> GCC/gfortran. I try to get an overview about the August backlog and reply to
> the missing items; in particular to that patch.
That would be great, it's been hanging in there for a while now ...