-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
For the following program
integer, parameter :: sp = kind(1.0e0)
type :: d1
real(sp) :: val
end type
type(d1), target :: b(5)
real(sp), pointer, contiguous :: c(:)
b%val = 1.0_sp
c => b%val
endflang, nvfortran, and nagfor accept it.
gfortran raises an error:
/app/example.f90:8:5:
8 | c => b%val
| 1
Error: Assignment to contiguous pointer from non-contiguous target at (1)ifx raises an error:
/app/example.f90(8): error #8377: An array is not contiguous if any part other than final has non-zero rank. [VAL]
c => b%val
-------^
/app/example.f90(8): error #8371: If pointer is declared CONTIGUOUS, target must be contiguous as well. [VAL]
c => b%val
-------^
compilation aborted for /app/example.f90 (code 1)Metadata
Metadata
Assignees
Labels
No labels