<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123090>123090</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[flang] Incorrect diagnostic on component initialization using intrinsic function
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DanielCChen
</td>
</tr>
</table>
<pre>
Consider the following code:
```
PROGRAM main
IMPLICIT NONE
TYPE :: DT
CHARACTER*(INT(ACOSD(0.5))) :: C=CHAR(INT(ACOSD(0.5)))
END TYPE
end
```
Flang currently issues an error as:
```
error: Semantic errors in a7.f
./a7.f:4:41: error: Must be a constant value
CHARACTER*(INT(ACOSD(0.5))) :: C=CHAR(INT(ACOSD(0.5)))
^^^^^^^^^^^^^^^^^^^^^
```
This seems wrong to me. All the intrinsic functions used in initialization can be folded at the compile time.
All of ifort, gfortran and XLF compile the above code successfully.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0U0GvozYQ_jXmMlrkmBDCgYNLQhtpX95TNof2aMwYXBk7sk1Wr7--Mkm70ntSL9VKgzDDfPbM5-8TIejRIjak_IWUh0wscXK-OQir0bTthDbr3fDetM4GPaCHOCEoZ4z7ru0I0g1ICk4oJzv6DMoB3i6vv174C8xC2zVxenn7empPVzi_no9rBuD6x9sRErrgcLimZPsbv_D2erwQxgnbn85Xwva8ff12IGxP85Kw-hHwD64lxSGh_rP6ed7xfFjPTJ9ohw9NE8o7I9JMi_doo3kHHcKCAYQF9N55EOHzrOuf1Mk3nIWNWj5qA2gLosoVoTwnrFuXBd-mZ5PK_8W9LCFCjyBAOhuisBHuwiz4k_kg5fF_xSfyrpMOEBDnAN-9syNEBzPmwI1ZRaNt9NoGLUEtVkbtbIAl4JCI0lZHLYz-S6Q8SGETI8qZAQcQccVLN9-0QYh6xpxQnvZ1CrRyPhLWwpgWXlgQdoDfv3Y_ABOC6N0dV7VCWKTEENRizHsOhPJsaIqhLmqRYbOpil29o1VZZVNTqqqoy73aq72strgryl5RWUpVbHrcV9tMN4yykm425aaiZbnNUW1xqCljwyAHUSuypTgLbXJj7nPu_Jitkmo2rKA1zYzo0YTVeoypJD5ScOWdjUmejCVD-iZhv_TLGMiWGh1i-LFb1NGs1n2AywOcrHTeo4wwaDFaF5IiE6VuvjmLNn7kegnJx58vJ1u8aaYYb6vmWUdYN-o4LX0u3UxYl3p4vr7cvPsTZSSseziGsO454b1hfwcAAP__bEFMvw">