Provisional patch to implement class arrays
Paul Richard Thomas
paul.richard.thomas@gmail.com
Sat Oct 22 13:29:00 GMT 2011
Dear Dominique,
Thanks for taking a look. The ICE occurs for exactly the kind of
operation that I am trying to fix.
You should note that you example gives with ifort 11.1
dominique_1.f90(9): error #5082: Syntax error, found '::' when
expecting one of: ( % : . = =>
generic :: assignment(=) => assign
-----------^
dominique_1.f90(9): error #5082: Syntax error, found '=>' when
expecting one of: , <END-OF-STATEMENT> ;
generic :: assignment(=) => assign
----------------------------^
dominique_1.f90(34): error #8296: In an intrinsic assignment
statement, variable shall not be polymorphic. [DTHIS_DX]
dthis_dx(i) = this%x(i)
-----^
compilation aborted for dominique_1.f90 (code 1)
Cheers
Paul
On Sat, Oct 22, 2011 at 3:02 PM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
> Paul, I have applied your patch on top of revision 180325.
> I did not have the time yet to perform a full testing, but
> I got an ICE with the following code
>
> [macbook] f90/bug% cat oop_8_db.f90
> module field_interface
> implicit none
>
> type, abstract :: field
> contains
> procedure(first_derivative) ,deferred :: x
> procedure ,non_overridable :: x_all_directions
> procedure(defined_assignment) ,deferred :: assign
> generic :: assignment(=) => assign
> end type
>
> abstract interface
> function first_derivative(this,direction) result(dthis_dx)
> import :: field
> class(field) ,intent(in) :: this
> integer ,intent(in) :: direction
> class(field) ,allocatable :: dthis_dx
> end function
> subroutine defined_assignment(lhs,rhs)
> import :: field
> class(field) ,intent(out) :: lhs
> class(field) ,intent(in) :: rhs
> end subroutine
> end interface
>
> contains
> function x_all_directions(this) result(dthis_dx)
> class(field) ,intent(in) :: this
> class(field) ,dimension(:) ,allocatable :: dthis_dx
> integer ,parameter :: space_dimension=3
> integer :: i
> allocate(dthis_dx(space_dimension) , source=this)
> do i=1,space_dimension
> dthis_dx(i) = this%x(i)
> end do
> end function
> end module
> end
> [macbook] f90/bug% gfc oop_8_db.f90
> oop_8_db.f90: In function 'x_all_directions':
> oop_8_db.f90:34:0: internal compiler error: in gfc_conv_descriptor_offset, at fortran/trans-array.c:210
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
>
> I also tried a couple tests I was expecting to pass, but AFAICT
> they seem to be blocked by other pr.
>
> I'll be off the hook for the coming week, so don't expect quick
> answer;-)
>
> Thanks for the patch,
>
> Dominique
>
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy
More information about the Fortran
mailing list