gcc/testsuite/gfortran.dg/pr113503_1.f90
raw| 1 | ! PR fortran/113503 |
| 2 | ! { dg-do compile } |
| 3 | ! { dg-options "-O2 -fno-inline -Wuninitialized" } |
| 4 | |
| 5 | program pr113503 |
| 6 | implicit none |
| 7 | type :: T |
| 8 | character(len=:), allocatable :: u |
| 9 | end type |
| 10 | character(len=20) :: us(1) = 'foobar' |
| 11 | type(T) :: x |
| 12 | x = T(u = trim (us(1))) ! { dg-bogus "is used uninitialized" } |
| 13 | call foo |
| 14 | contains |
| 15 | subroutine foo |
| 16 | if (x%u /= 'foobar') stop 1 |
| 17 | end subroutine |
| 18 | end |