The patch consists of two parts:

* The pointer check in gfc_check_vardef_context didn't honour polymorphic variables

* Passing a TYPE to a CLASS is not allowed if CLASS is a pointer or allocatable as the actual argument cannot change its effective type. However, if the dummy is an intent(in)-pointer, there is no risk of doing so. Thus, one can allow this.

The latter is an interpretation request (F08/0073), which passed the J3 meeting. It is in line of the Fortran 2008 feature, where one can pass a TARGET variable (i.e. nonpointer) to an intent-in pointer dummy argument.

Build and regtested on x86-64-linux
OK for the (4.8) trunk?

Tobias

PS: Other pending patches, awaiting review:
- http://gcc.gnu.org/ml/fortran/2012-02/msg00081.html (test suite failures)
- http://gcc.gnu.org/ml/fortran/2012-02/msg00071.html (-Wrealloc-lhs)
- http://gcc.gnu.org/ml/fortran/2012-02/msg00067.html (I/O vtable)

Pending committal (optional dummy):
- http://gcc.gnu.org/ml/fortran/2012-02/msg00062.html
- http://gcc.gnu.org/ml/fortran/2012-02/msg00061.html

Attachment: ptr-intent-v2.diff
Description: application/unknown

Reply via email to