[flang-commits] [flang] cd92c42 - [flang][runtime] Don't emit runtime error for "AA" editing (#107714)
via flang-commits
flang-commits at lists.llvm.org
Tue Sep 10 14:13:31 PDT 2024
Author: Peter Klausler
Date: 2024-09-10T14:13:28-07:00
New Revision: cd92c4255582299b9a55fa0dc485982b8f54c49a
URL: https://github.com/llvm/llvm-project/commit/cd92c4255582299b9a55fa0dc485982b8f54c49a
DIFF: https://github.com/llvm/llvm-project/commit/cd92c4255582299b9a55fa0dc485982b8f54c49a.diff
LOG: [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".
Added:
Modified:
flang/runtime/format-implementation.h
Removed:
################################################################################
diff --git a/flang/runtime/format-implementation.h b/flang/runtime/format-implementation.h
index 74254bebe6e7a8..46204ca927c135 100644
--- a/flang/runtime/format-implementation.h
+++ b/flang/runtime/format-implementation.h
@@ -443,8 +443,9 @@ RT_API_ATTRS int FormatControl<CONTEXT>::CueUpNextDataEdit(
if (ch != 'P') { // 1PE5.2 - comma not required (C1302)
CharType peek{Capitalize(PeekNext())};
if (peek >= 'A' && peek <= 'Z') {
- if (ch == 'A' /* anticipate F'202X AT editing */ || ch == 'B' ||
- ch == 'D' || ch == 'E' || ch == 'R' || ch == 'S' || ch == 'T') {
+ if ((ch == 'A' && peek == 'T' /* anticipate F'202X AT editing */) ||
+ ch == 'B' || ch == 'D' || ch == 'E' || ch == 'R' || ch == 'S' ||
+ ch == 'T') {
// Assume a two-letter edit descriptor
next = peek;
++offset_;
More information about the flang-commits
mailing list