<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99288>99288</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] No error checking when nested structure statement has no field name
</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-new : 19.0.0(73447a3302541c343525570222b318e7f94f9402)/AArch64
```
`structure` statement is an extension, but Flang-new supports it.
A nested `structure` statement must have at least one field name, but attached program does not specify a field name.
However, Flang-new does not detect error during compilation and does not output error message.
Gfortran and ifort output compilation error message.
The following are the test program, Flang-new, Gfortran and ifort compilation/execution result.
3-P-405-structure-inner01_2.f90:
```fortran
structure /tp1/
integer(kind=4) :: ma0 = 10
integer(kind=4) :: ma1
real(kind=8) :: mb0
real(kind=8) :: mb1 = 2.0
structure /tp2/
integer(kind=8) :: za0 = 50
end structure
end structure
record /tp1/ a
record /tp2/ b
print *, a
print *, b
end
```
```
$ flang-new 3-P-405-structure-inner01_2.f90
$
```
```
$ gfortran 3-P-405-structure-inner01_2.f90 -fdec-structure
3-P-405-structure-inner01_2.f90:6:19:
6 | structure /tp2/
| 1
Error: Invalid character in name at (1)
3-P-405-structure-inner01_2.f90:9:5:
9 | end structure
| 1
Error: Expecting END PROGRAM statement at (1)
3-P-405-structure-inner01_2.f90:12:15:
12 | record /tp2/ b
| 1
Error: Derived type ‘tp2’ at (1) is being used before it is defined
$
```
```
$ ifort -diag-disable=10448 3-P-405-structure-inner01_2.f90
3-P-405-structure-inner01_2.f90(6): error #7038: A nested structure declaration must have at least one field name in the field list.
structure /tp2/
---------------^
compilation aborted for 3-P-405-structure-inner01_2.f90 (code 1)
$
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVl-TmzYQ_zTyyw4eIYGBBz-48TntQ9NMptPXjk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