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

msteghofer at cistib dot upf.edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msteghofer at cistib dot
                   |                            |upf.edu

--- Comment #3 from msteghofer at cistib dot upf.edu 2011-10-03 10:16:51 UTC ---
I've got a very similar problem (attachment above). The difference is that I'm
not using assignments to write something inside the intent(in) pointer, but I'm
calling the function move_alloc with something inside the intent(in) pointer as
actual argument.

Please see the attached code above for details. The error message (gfortran
4.6.1) is the following:

bug.f90:22.20:
    CALL MOVE_ALLOC(POINTER_INTENT_IN_VARIABLE%VALUE, LOCAL_VALUE)
                    1
Error: 'from' argument of 'move_alloc' intrinsic at (1) cannot be INTENT(IN)

As the error message is different from the one posted before, I'm not sure, if
this is the same bug, please check. If it's not, I will post a new report - I
just want to avoid duplicates.

Also I'm not sure about what the Fortran standard says, but I don't think that
giving this error is a desired behaviour because:
* According to documentation of other compilers the code should compile:
http://publib.boulder.ibm.com/infocenter/comphelp/v111v131/topic/com.ibm.xlf131.aix.doc/language_ref/intent.html
(section "Rules", subsection about pointer dummy arguments)
* If INTENT(IN) really tries to protect the *members* (not the pointer itself)
of the derived type from being changed (that's the only scenario in which this
behaviour would make sense), then it's not doing its job: Copying the pointer
to a local variable I'm able to change them, as the example
"POINTER_INTENT_IN_BUG_WORKING" in the attached code shows.

Reply via email to