http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45740

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |

--- Comment #7 from janus at gcc dot gnu.org 2010-10-02 15:25:04 UTC ---
(In reply to comment #6)
> I still do not see what is meant by the
> "proc-pointer" part in
> 
> "C551 A nonpointer object that has the PROTECTED attribute and is accessed by
> use association shall not appear [...] as the [...] proc-target in a
> pointer-assignment-stmt."
> 
> as PROTECTED can only be applied to proc pointers (and normal variables).

Ok, I think the only way this half-sentence and the interpretation on the J3
mailing list make sense, is via the following interpretation. Consider:

integer, pointer :: lhs, rhs
lhs => rhs

In such a pointer assignment statement, the object on the right hand side
supposedly does not have the pointer attribute (the pointer is dereferenced, so
that 'lhs' will point to the target of 'rhs'). With this reading, C551 can be
applied to (proc-/data-)pointer assignments as well, and the sentence about
'proc-target' does make sense.

[I hate these kinds of subtleties in reading the standard and hope I got it
right this time.]

Also, from a "common sense" POV, it is important to reject protected pointers
on the rhs of a pointer assignment, otherwise the PROTECTED feature could be
circumvented this way.

Reply via email to