[Patch, Fortran] PR 52270 - OOP - pointer check in vardef context, passing to intent-in ptr

Tobias Burnus burnus@net-b.de
Sun Feb 19 00:46:00 GMT 2012

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?


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptr-intent-v2.diff
Type: application/unknown
Size: 3149 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120219/dc3cf7fc/attachment.bin>

More information about the Gcc-patches mailing list