Issue 125446
Summary [Flang] Incorrect message when concat-op is specified for io-unit
Labels flang:frontend
Assignees
Reporter ohno-fj
    ```
Version of flang : 20.0.0(1c4341d176492da5f276937b84a3d0c959e4cf5b)/AArch64
```
The attached program is incorrect.  
When `concat-op` is specified for `io-unit`, a compilation error occurs.  
The message is outputted as `Must have INTEGER`. However, `io-unit` can also specify CHARACTER (`internal-file-variable` = `char-variable`).  
The message is incorrect and should output a message similar to Gfortran.  


The following are the test program, Flang, Gfortran and ifx compilation/execution result.

read.f:
```fortran
      character a,b
      read(b//b,*) a
 end
```

```
$ flang read.f
error: Semantic errors in read.f
./read.f:2:12: error: Must have INTEGER type, but is CHARACTER(1)
 read(b//b,*) a
             ^^^^
$
```

```
$ gfortran read.f
read.f:2:11:

    2 |       read(b//b,*) a
      | 1
Error: UNIT specification at (1) must be an INTEGER _expression_ or a CHARACTER variable
$
```

```
$ ifx read.f
read.f(2): error #6324: This specifier has already been used in this I/O operation.
      read(b//b,*) a
^
read.f(2): error #6330: There is a direction conflict for this I/O operation.
      read(b//b,*) a
^
compilation aborted for read.f (code 1)
$
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to