| 1 |
! { dg-do compile } |
| 2 |
|
| 3 |
! Initialization of character by non-character constructor |
| 4 |
|
| 5 |
subroutine s1 |
| 6 |
type t |
| 7 |
integer :: n = 0 |
| 8 |
end type |
| 9 |
type t2 |
| 10 |
character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" } |
| 11 |
end type |
| 12 |
end subroutine |
| 13 |
|
| 14 |
subroutine s2 |
| 15 |
type t |
| 16 |
end type |
| 17 |
type t2 |
| 18 |
character :: c(1) = [t()] ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" } |
| 19 |
end type |
| 20 |
end subroutine |
| 21 |
|
| 22 |
subroutine s3 |
| 23 |
type t |
| 24 |
integer :: a = 1 |
| 25 |
character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" } |
| 26 |
end type |
| 27 |
end subroutine |
| 28 |
|
| 29 |
subroutine s4 |
| 30 |
type t |
| 31 |
integer, allocatable :: a |
| 32 |
character :: c = t() ! { dg-error "Cannot convert TYPE\\(t\\) to CHARACTER\\(1\\)" } |
| 33 |
end type |
| 34 |
end subroutine |