[flang-commits] [flang] [flang] Accept C-style comments in label fields (PR #207012)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Sun Jul 19 20:10:17 PDT 2026


eugeneepshteyn wrote:

Consider the following program:
```
      program p
      integer :: n
      n = 7
      write(*,10) n, n+1, n+2
   10 format(1x,i2/*(i3))
      end
```
In this case, `/`  is a record terminator, and then `*(i3)` reads a bunch of i3. This unparses as follows:
```
$ flang -fc1 -fdebug-unparse p-format3-good.f 
PROGRAM P
 INTEGER n
  n=7_4
 WRITE (*, 10) n, n+1_4, n+2_4
 10 FORMAT(1X,I2,/,*(I3))
END PROGRAM
```
What should we do about this program, which currently fails?
```
      program p
      integer :: n
      n = 7
      write(*,10) n, n+1, n+2
   10 format(1x,i2/*(i3))
      print *, 'tail */ text'
      end
```
If not for C style comments, this should be perfectly valid, right?

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


More information about the flang-commits mailing list