| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fdump-tree-original" } |
| 3 |
! |
| 4 |
! Test the fix for the 14/15 regression PR118750 |
| 5 |
! |
| 6 |
! Contributed by Damian Rouson <[email protected]> |
| 7 |
! |
| 8 |
implicit none |
| 9 |
|
| 10 |
type string_t |
| 11 |
character(:), allocatable :: str |
| 12 |
end type |
| 13 |
|
| 14 |
associate(str_a => get_string([string_t ("abcd"),string_t ("ef")])) |
| 15 |
if (str_a(1)%str//str_a(2)%str /= "abcdef") STOP 1 ! Returned "Invalid array reference at (1)" |
| 16 |
end associate |
| 17 |
|
| 18 |
contains |
| 19 |
|
| 20 |
type(string_t) elemental function get_string(mold) |
| 21 |
class(string_t), intent(in) :: mold |
| 22 |
get_string = string_t(mold%str) |
| 23 |
end function |
| 24 |
|
| 25 |
end |
| 26 |
! { dg-final { scan-tree-dump-times "array01_string_t str_a" 1 "original" } } |