gcc/testsuite/gfortran.dg/cray_pointers_11.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! { dg-options "-fcray-pointer" } |
| 3 | ! |
| 4 | ! PR fortran/62174 |
| 5 | ! Component declarations within derived types would overwrite the typespec of |
| 6 | ! variables with the same name who were Cray pointees. |
| 7 | implicit none |
| 8 | |
| 9 | type t1 |
| 10 | integer i |
| 11 | end type t1 |
| 12 | type(t1) x |
| 13 | |
| 14 | pointer (x_ptr, x) |
| 15 | |
| 16 | type t2 |
| 17 | real x ! should not overwrite x's type |
| 18 | end type t2 |
| 19 | |
| 20 | x%i = 0 ! should see no error here |
| 21 | |
| 22 | end |