Skip to content

Commit 4a4599c

Browse files
committed
Fix BOZ constants for standard compliance
``` 11 | character(C_CHAR), parameter :: CR = char(Z'0D', C_CHAR) | 1 Error: A BOZ literal constant at (1) cannot appear as an actual argument in a function reference ``` according to the standard, the special literals only work as arguments to `int` and in a few other situations.
1 parent 7348c22 commit 4a4599c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Examples/test-suite/fortran/string_constants_runme.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ program string_constants_runme
88
implicit none
99
type(things) :: foo
1010
! note: Z'deadbeef' and O'777' are used to generate hex and oct constants
11-
character(C_CHAR), parameter :: CR = char(Z'0D', C_CHAR)
12-
character(C_CHAR), parameter :: LF = char(O'12', C_CHAR)
11+
character(C_CHAR), parameter :: CR = char(int(Z'0D'), C_CHAR)
12+
character(C_CHAR), parameter :: LF = char(int(O'12'), C_CHAR)
1313
character(kind=C_CHAR, len=*), parameter :: &
1414
expected_aa3 = "A" // CR // "B" // LF // "C"
1515
character(kind=C_CHAR, len=:), allocatable :: actual_aa3

0 commit comments

Comments
 (0)