This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48890] length of a character derived-type component with PARAMETER
- From: "fxcoudert at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 03 May 2015 21:32:41 +0000
- Subject: [Bug fortran/48890] length of a character derived-type component with PARAMETER
- Auto-submitted: auto-generated
- References: <bug-48890-4 at http dot gcc dot gnu dot org/bugzilla/>
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