[flang-commits] [flang] [flang][runtime] Don't emit runtime error for "AA" editing (PR #107714)

via flang-commits flang-commits at lists.llvm.org
Sat Sep 7 13:00:49 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-runtime

Author: Peter Klausler (klausler)

<details>
<summary>Changes</summary>

Commas are optional between edit descriptors in a format, so treat "AA" as if it were "A,A".

---
Full diff: https://github.com/llvm/llvm-project/pull/107714.diff


1 Files Affected:

- (modified) flang/runtime/format-implementation.h (+3-2) 


``````````diff
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_;

``````````

</details>


https://github.com/llvm/llvm-project/pull/107714


More information about the flang-commits mailing list