This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/79072] ICE with class(*) pointer function result and character value
- From: "neil.n.carlson at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Jan 2017 14:30:49 +0000
- Subject: [Bug fortran/79072] ICE with class(*) pointer function result and character value
- Auto-submitted: auto-generated
- References: <bug-79072-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79072
--- Comment #5 from neil.n.carlson at gmail dot com ---
Here's a more complete example that avoids the ICE.
It gives correct results with 6.3:
5 fubar
5 fubar
But incorrect results with 7.0:
5 fubar
0
program main
class(*), pointer :: x, y
allocate(x, source='fubar')
y => foobar(x)
select type (y)
type is (character(*))
print *, len(y), y
end select
contains
function foobar(bar) result(foo)
class(*), pointer :: foo, bar
foo => bar
select type (foo)
type is (character(*))
print *, len(foo), foo
end select
end function
end program