------- Comment #2 from dominiq at lps dot ens dot fr  2009-10-23 07:37 -------
Reduced test case:

module abstract_gradient
  implicit none
  public :: vector_class
  public :: inner_product_class
  public :: gradient_class
  private

  type, abstract :: vector_class
  end type vector_class

  type, abstract :: inner_product_class
  end type inner_product_class

  type, abstract, extends(vector_class) :: gradient_class
    class(inner_product_class), pointer :: my_inner_product => null()
  contains
    procedure, public, non_overridable  :: inquire_inner_product
  end type gradient_class
contains
  function inquire_inner_product (this)
    class(gradient_class)               :: this
    class(inner_product_class), pointer :: inquire_inner_product
    inquire_inner_product => this%my_inner_product
  end function inquire_inner_product
end module abstract_gradient
module abstract_conjugate_gradients
  use abstract_gradient
  implicit none
contains
  subroutine cg (g_initial)
    class(gradient_class),  intent(in)    :: g_initial

    class(inner_product_class), pointer   :: ip_save
    ip_save => g_initial%inquire_inner_product()   ! ICE
  end subroutine cg
end module abstract_conjugate_gradients

The ICE goes away if I comment line 6:

  private


-- 


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

Reply via email to