[all-commits] [llvm/llvm-project] ec4ba0: [flang][runtime] Correct automatic parenthesized f...

Peter Klausler via All-commits all-commits at lists.llvm.org
Mon Nov 13 14:53:05 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec4ba0f5fe83c0e90ae6a56ffd417a4603e71501
      https://github.com/llvm/llvm-project/commit/ec4ba0f5fe83c0e90ae6a56ffd417a4603e71501
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2023-11-13 (Mon, 13 Nov 2023)

  Changed paths:
    M flang/runtime/format-implementation.h
    M flang/runtime/format.h
    M flang/unittests/Runtime/Format.cpp

  Log Message:
  -----------
  [flang][runtime] Correct automatic parenthesized format repetition case (#71436)

In Fortran, a format automatically repeats, with a line break, until all
the data items of a data transfer statement have been consumed. PRINT
"(3I4)", 1, 2, 3, 4, 5, 6 prints two lines, for example, three values
each.

When there are nested parentheses in a format, the rightmost set of
parentheses at the top level are used for automatic repetition. PRINT
"(I4,2(I4))" 1, 2, 3, 4, 5, 6, 7 print three lines, with three values on
the first and two each on the later ones.

Fix a bug in format interpretation that causes the detection of the
"rightmost" set of parentheses to take place on each pass, leading to
problems when parentheses are even further nested.




More information about the All-commits mailing list