[flang-commits] [PATCH] D125056: [flang][runtime] (G0) for CHARACTER means (A), not (A0)

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon May 9 13:00:33 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG28b5e99a4c84: [flang][runtime] (G0) for CHARACTER means (A), not (A0) (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125056/new/

https://reviews.llvm.org/D125056

Files:
  flang/runtime/edit-output.cpp


Index: flang/runtime/edit-output.cpp
===================================================================
--- flang/runtime/edit-output.cpp
+++ flang/runtime/edit-output.cpp
@@ -627,9 +627,15 @@
 template <typename CHAR>
 bool EditCharacterOutput(IoStatementState &io, const DataEdit &edit,
     const CHAR *x, std::size_t length) {
+  int len{static_cast<int>(length)};
+  int width{edit.width.value_or(len)};
   switch (edit.descriptor) {
   case 'A':
+    break;
   case 'G':
+    if (width == 0) {
+      width = len;
+    }
     break;
   case 'B':
     return EditBOZOutput<1>(io, edit,
@@ -646,8 +652,6 @@
         edit.descriptor);
     return false;
   }
-  int len{static_cast<int>(length)};
-  int width{edit.width.value_or(len)};
   return io.EmitRepeated(' ', std::max(0, width - len)) &&
       io.EmitEncoded(x, std::min(width, len));
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125056.428180.patch
Type: text/x-patch
Size: 852 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220509/b5b8c0c4/attachment.bin>


More information about the flang-commits mailing list