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

             Bug #: 51791
           Summary: [OOP] Failure to resolve typebound function call with
                    base object in parentheses.
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: pa...@gcc.gnu.org


The submitted testcase for PR46328 is not fixed, even though the other issues
of complex expressions were:

module field_module
  implicit none
  type ,abstract :: field
  contains
    procedure(field_op_real) ,deferred :: multiply_real
    generic :: operator(*) => multiply_real
  end type
  abstract interface
    function field_op_real(lhs,rhs)
      import :: field
      class(field) ,intent(in)  :: lhs
      real ,intent(in) :: rhs
      class(field) ,allocatable :: field_op_real
    end function
  end interface
end module

program main
  use field_module
  implicit none
  class(field) ,pointer :: u
  u = (u)*2.
end program

The problem is the parentheses.

The attached fixes the problem, when the procedure is not deferred.  However,
it causes such a variety of regressions that I do not have time to investigate.

Cheers

Paul

Reply via email to