gcc/testsuite/gfortran.dg/pr100193.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! Contributed by Gerhard Steinmetz <[email protected]> |
| 4 | ! |
| 5 | module m |
| 6 | implicit none |
| 7 | type t |
| 8 | procedure(f), pointer, nopass :: g |
| 9 | end type |
| 10 | contains |
| 11 | function f() |
| 12 | character(:), allocatable :: f |
| 13 | f = 'abc' |
| 14 | end |
| 15 | subroutine s |
| 16 | type(t) :: z |
| 17 | z%g = 'x' ! { dg-error "is a procedure pointer" } |
| 18 | if ( z%g() /= 'abc' ) stop |
| 19 | end |
| 20 | end |