Skip to content

Commit cd92c42

Browse files
authored
[flang][runtime] Don't emit runtime error for "AA" editing (#107714)
Commas are optional between edit descriptors in a format, so treat "AA" as if it were "A,A".
1 parent 26ac30b commit cd92c42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flang/runtime/format-implementation.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,9 @@ RT_API_ATTRS int FormatControl<CONTEXT>::CueUpNextDataEdit(
443443
if (ch != 'P') { // 1PE5.2 - comma not required (C1302)
444444
CharType peek{Capitalize(PeekNext())};
445445
if (peek >= 'A' && peek <= 'Z') {
446-
if (ch == 'A' /* anticipate F'202X AT editing */ || ch == 'B' ||
447-
ch == 'D' || ch == 'E' || ch == 'R' || ch == 'S' || ch == 'T') {
446+
if ((ch == 'A' && peek == 'T' /* anticipate F'202X AT editing */) ||
447+
ch == 'B' || ch == 'D' || ch == 'E' || ch == 'R' || ch == 'S' ||
448+
ch == 'T') {
448449
// Assume a two-letter edit descriptor
449450
next = peek;
450451
++offset_;

0 commit comments

Comments
 (0)