https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123782

--- Comment #17 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
nagfor accepts it.

$ cat pr123782.f90 
type :: t1
  real :: x
end type

type :: t2
  real :: x, y
end type

type(t1), target :: a(5) ! supposed to be contiguous
type(t2), target :: b(5)

real, pointer, contiguous :: c(:)

a%x = 1.0

b%x = 2.0
b%y = 3.0

c => a%x   ! False error?
!c => b%x   ! Error: assignment to contiguous pointer from non-contiguous
target
print *, c
end

$ nagfor pr123782.f90 
NAG Fortran Compiler Release 7.2(Shin-Urayasu) Build 7238
Questionable: pr123782.f90, line 22: Variable B set but never referenced
[NAG Fortran Compiler normal termination, 1 warning]
$ ./a.out 
   1.0000000   1.0000000   1.0000000   1.0000000   1.0000000
$ 

I suggest you cleanup the patch and post a changelog Steve.

Reply via email to