<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/107341>107341</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Error: INTEGER(KIND=-1) is not a supported type when disabling integer(KIND=16)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            flang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Renaud-K
      </td>
    </tr>
</table>

<pre>
    With the following test:
test.f90
`
integer(8) :: x
integer(Selected_Int_Kind(Range(x)+1)) y
end
`
flang-new errors when disabling integer(KIND=16)
`flang-new -fc1 -fdisable-integer-16 test.f90`

`
error: Semantic errors in test.f90
./test.f90:2:1: error: INTEGER(KIND=-1) is not a supported type
 integer(Selected_Int_Kind(Range(x)+1)) y
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
`


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEU0tvpDwQ_DXNxQKZ5ukDh4lm-BRFyiH5pD1GBjfglceMsMnj36-AeShzWu0eVkIYA1VdXe6SzuneElWQPUC2D-Tsh3GqXsjKWYVPQTOqr-qH9gPzA7FuNGb80LZnnpyHZAd8D3y3bKJO8G0H-flBW089TYBlCSjY8nuyY5_3H1_JUOtJvT1a__akrQIsX6TtCbD8BBSAD_G6CPa1Ycmqu1KdkbYPLX0wmqZxcuxjIMuUdrIxi9xbtafH5z0k-zhfKC8kN3jYtTELuw1J4RkXxjm7NnmpeSdhLbw0-EpHab1uL1K0Zd8NigDr65tkh5Ds4gV4ZXh8_v_w3-HlpjZcDGDaMTt6JpmbT6dx8qSY_zrRRsr-xlAG2eHfXN893O6BqhIlEiEDquICs1SIsiyDocpTLERGKpMy71Ta5JyXjUAlZNIVqlSBrpBjygXPeJzEWEQdbyktOMm2aZHaHFJOR6lNZMz7MRqnPtDOzVTFvEjSODCyIePWLCCuQwGISyymagGEzdw7SLnRzrsbhdferAHaENmeHf7sJH9vaoN5MtXg_ckticIasO61H-YmascjYL3oOi_haRp_UusB67VPB1ifW32v8FcAAAD__x1GJck">