This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/48890] length of a character derived-type component with PARAMETER


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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu.org

--- Comment #2 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
This is indeed a wrong-code bug. It's been reported on comp.lang.fortran today:

   implicit none
   type :: a_t
      character(len=10) :: s = "x"
   end type a_t
   type(a_t), parameter :: foo = a_t("")
   type(a_t), parameter :: bar = a_t()
   print *, len(foo%s), len_trim(foo%s)
   print *, len(bar%s), len_trim(bar%s)
   end

gives

           0           0
          10           1

while it should give:

          10           0
          10           1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]