https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121060

            Bug ID: 121060
           Summary: ICE when argument is associate name created from
                    type-bound operator result
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: damian at archaeologic dot codes
  Target Milestone: ---

% cat all.f90 
module subdomain_m
  implicit none

  type subdomain_t 
    real :: s_ = 0.
  contains
    generic :: operator(.laplacian.) => laplacian
    procedure laplacian
  end type

contains

  function laplacian(rhs)
    class(subdomain_t), intent(in) :: rhs
    type(subdomain_t) laplacian
  end function

end module

  use subdomain_m
  implicit none

  type operands_t
  end type

  type(subdomain_t) phi
  type(operands_t) operands

  associate(laplacian_phi => .laplacian. phi)
    operands = approximates(laplacian_phi%s_)
  end associate

contains

  function approximates(actual)
    real actual 
    type(operands_t) approximates
  end function

end

% gfortran all.f90 
f951: internal compiler error: in matching_typebound_op, at
fortran/interface.cc:4763
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/Homebrew/homebrew-core/issues> for instructions.

% gfortran --version
GNU Fortran (Homebrew GCC 15.1.0) 15.1.0

Reply via email to