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

           Summary: SIZE(TRANSFER()) as specification expression
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: bur...@gcc.gnu.org


Found at
https://www.jiscmail.ac.uk/cgi-bin/webadmin?A1=ind1012&L=COMP-FORTRAN-90#2

Related: (C_)SIZEOF PR 46641

It seems as if the following might be valid - though none of my compiler
supports it. Steve Lionel wrote: "My reading of F2003 suggests that this
qualifies as a legal specification expression."


Example:

module something_mod
  integer, parameter :: dp = selected_real_kind(12)
  type something_type
      real(dp) :: a = 0.0_dp
      real(dp) :: b = 0.0_dp
      real(dp) :: c = 0.0_dp
  end type something_type
  type(something_type),save :: something
end module something_mod

  use something_mod
  integer :: something_array(size(transfer(something,(/0/))))
end

Reply via email to