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

            Bug ID: 121948
           Summary: gfortran rejects structure constructor without
                    (default) derived type parameter
           Product: gcc
           Version: 16.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 operands.f90 
  implicit none

  type operands_t(k)
    integer, kind :: k = kind(1.)
    real(k) actual, expected 
  end type

contains

  function operands(actual, expected)
    real actual, expected
    type(operands_t) operands
    operands = operands_t(actual, expected) 
  end function

end
rouson@headroom:~$ gfortran operands.f90 
operands.f90:13:26:

   13 |     operands = operands_t(actual, expected)
      |                          1
Error: The type parameter expression at (1) must be of INTEGER type and not
REAL
rouson@headroom:~$ gfortran --version
GNU Fortran (GCC) 16.0.0 20250910 (experimental)

Reply via email to