This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/49562] [4.6/4.7 Regression] [OOP] assigning value to type-bound function
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Jun 2011 12:53:03 +0000
- Subject: [Bug fortran/49562] [4.6/4.7 Regression] [OOP] assigning value to type-bound function
- Auto-submitted: auto-generated
- References: <bug-49562-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49562
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|ice-on-invalid-code |ice-on-valid-code
Summary|[4.6/4.7 Regression] [OOP] |[4.6/4.7 Regression] [OOP]
|ICE-on-invalid: assigning |assigning value to
|value to type-bound |type-bound function
|function |
--- Comment #5 from janus at gcc dot gnu.org 2011-06-28 12:52:58 UTC ---
Note: You can get the same ICE on *valid* code, if you give the return value of
'ice_func' the POINTER attribute (allowed by F08):
module ice
type::ice_type
contains
procedure::ice_func
end type ice_type
contains
pure function ice_func(this)
integer, pointer :: ice_func
class(ice_type),intent(in)::this
ice_func=1
end function ice_func
subroutine ice_sub(a)
class(ice_type)::a
a%ice_func()=1 ! This is valid now
end subroutine ice_sub
end module ice
Unfortunately this test case is rejected with the patch in comment #2.