Commit 9367d533 by Janus Weil

re PR fortran/45827 ([OOP] mio_component_ref(): Component not found)

2010-12-28  Janus Weil  <janus@gcc.gnu.org>
	    Daniel Franke  <dfranke@gcc.gnu.org>

	PR fortran/45827
	* module.c (mio_component_ref): Handle components of CLASS variables.


2010-12-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/45827
	* gfortran.dg/class_32.f90: New.

Co-Authored-By: Daniel Franke <dfranke@gcc.gnu.org>

From-SVN: r168302
parent 040d39ee
2010-12-28 Janus Weil <janus@gcc.gnu.org>
Daniel Franke <dfranke@gcc.gnu.org>
PR fortran/45827
* module.c (mio_component_ref): Handle components of CLASS variables.
2010-12-27 Thomas Koenig <tkoenig@gcc.gnu.org>
* dump-parse-tree.c (show_typespec): Also show character kind.
......
......@@ -2311,6 +2311,9 @@ mio_component_ref (gfc_component **cp, gfc_symbol *sym)
{
mio_internal_string (name);
if (sym && sym->attr.is_class)
sym = sym->components->ts.u.derived;
/* It can happen that a component reference can be read before the
associated derived type symbol has been loaded. Return now and
wait for a later iteration of load_needed. */
......
2010-12-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/45827
* gfortran.dg/class_32.f90: New.
2010-12-28 H.J. Lu <hongjiu.lu@intel.com>
* gcc.target/i386/rdrand-1.c: Updated.
......
! { dg-do compile }
!
! PR 45827: [4.6 Regression] [OOP] mio_component_ref(): Component not found
!
! Contributed by Daniel Franke <dfranke@gcc.gnu.org>
MODULE m
TYPE, ABSTRACT :: t
PRIVATE
INTEGER :: n
CONTAINS
PROCEDURE :: get
END TYPE
ABSTRACT INTERFACE
SUBROUTINE create(this)
IMPORT t
CLASS(t) :: this
END SUBROUTINE
END INTERFACE
CONTAINS
FUNCTION get(this)
CLASS(t) :: this
REAL, DIMENSION(this%n) :: get
END FUNCTION
SUBROUTINE destroy(this)
CLASS(t) :: this
END SUBROUTINE
END MODULE
PROGRAM p
USE m
END
! { dg-final { cleanup-modules "m" } }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment