File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ include(testing)
55
66project (gfortran-bug Fortran)
77
8+ add_compiler_test(SOURCES gfortran-20201204.f90 RUN_ONLY LABELS PR98141)
89add_compiler_test(SOURCES gfortran-20200501.f90 COMPILE_ONLY LABELS PR94909)
910add_compiler_test(SOURCES gfortran-20200402-file1.f90 gfortran-20200402-file2.f90
1011 LINK_ONLY LABELS PR94463)
Original file line number Diff line number Diff line change 1+ module foo
2+
3+ type, public :: any_scalar
4+ class(* ), allocatable :: value
5+ contains
6+ procedure :: alloc
7+ end type
8+
9+ contains
10+
11+ subroutine alloc (this , value )
12+ class(any_scalar), intent (out ) :: this
13+ class(* ), intent (in ) :: value
14+ allocate (this% value, source= value)
15+ end subroutine alloc
16+
17+ end module foo
18+
19+
20+ program prog
21+
22+ use foo
23+
24+ type (any_scalar) :: s1, s2, s3
25+ character (len= 0 ) :: c
26+
27+ ! ! No problem
28+ call s1% alloc(' ' )
29+
30+ ! ! Segfault
31+ call s2% alloc(' ' )
32+
33+ ! ! Segfault
34+ call s3% alloc(c)
35+
36+ end program
You can’t perform that action at this time.
0 commit comments