gcc/testsuite/gfortran.dg/no_char_to_numeric_assign.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! { dg-options "-fdec-char-conversions" } |
| 3 | ! |
| 4 | ! Test character variables can not be assigned to numeric and |
| 5 | ! logical variables. |
| 6 | ! |
| 7 | ! Test case contributed by Mark Eggleston <[email protected]> |
| 8 | ! |
| 9 | program test |
| 10 | integer a |
| 11 | real b |
| 12 | complex c |
| 13 | logical d |
| 14 | character e |
| 15 | |
| 16 | e = "A" |
| 17 | a = e ! { dg-error "Cannot convert" } |
| 18 | b = e ! { dg-error "Cannot convert" } |
| 19 | c = e ! { dg-error "Cannot convert" } |
| 20 | d = e ! { dg-error "Cannot convert" } |
| 21 | end program |