gcc/testsuite/gfortran.dg/class_23.f03
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! PR 42051: [OOP] ICE on array-valued function with CLASS formal argument |
| 4 | ! |
| 5 | ! Original test case by Damian Rouson <[email protected]> |
| 6 | ! Modified by Janus Weil <[email protected]> |
| 7 | |
| 8 | type grid |
| 9 | end type |
| 10 | |
| 11 | contains |
| 12 | |
| 13 | function return_x(this) result(this_x) |
| 14 | class(grid) :: this |
| 15 | real ,dimension(1) :: this_x |
| 16 | end function |
| 17 | |
| 18 | subroutine output() |
| 19 | type(grid) :: mesh |
| 20 | real ,dimension(1) :: x |
| 21 | x = return_x(mesh) |
| 22 | end subroutine |
| 23 | |
| 24 | end |