<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/125446>125446</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] Incorrect message when concat-op is specified for io-unit
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ohno-fj
</td>
</tr>
</table>
<pre>
```
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)
$
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVVFv4zYM_jXKCxFDkWwnfvCDlzZ3fdgN6LrtWZbpWAfFCiQ5bf_9QNtxc-2wK3CG2yQCRfL7-JFUIZhjj1iy7DeW3a3UEDvnS9f1bt1-X9WueS1ZzueXV3-jD8b14FporeqPwGQFgic84UzsNjqV6abZbPO0EI3KWrHNC7mtd6mSDddFVmCq26xmomDiUFVed3nKeHUb4alDUDEq3WEDZ--OXp3ABDC9dt6jjgkA49U_HfbAcq5dr1VcuzPLOZmFM2rTGmygdZ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