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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Cannot export function which uses static global resource
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          spall
      </td>
    </tr>
</table>

<pre>
    Disallowed because static is a 'temporary' local and all uses of a resource must be resolvable back to a global declaration of the resource. 
'const static' is allowed because it requires the variable to be initialized to a specific resource, so it should be resolvable.

https://godbolt.org/z/PjY9aePde
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxckkFv2zwMhn-NfCEa2FRcxwcf-rUwvkMPBXbakZaYWB1jeaKcrP31g92sw3oSIIF8HvElqYbTxNyZ-j9TPxW05DGmTmcSKYbo37qnoCQSr-xhYEeLMmimHBwEBQKDTebzHBOlN4MNSHQkQJMHEoFFWSEegSCxxiU5hvOiGQbeLuRCgzAM5H5AjkBwkjiQgGcnlCiHOK3VeeTP-h2Y8sFg4-Kk-WaycleZL5ohQ-KfS0isW4sLpbDxclwFwhRyIAnv7D_gOrMLx-A-WQYfQePaR8e4iP9Xe7eKlA9jzrMa-2CwN9ifoh-i5F1MJ4P9u8H-5fV7S_ziufCd9a1tqeCuauyhPFjb2mLsqtqWFdd4X9e-GQ62Retw72rbNoP1TV2EDkusywoP1X19b-3OlU3j-ViVSNW-PqLZl3ymIDuRy3llF0F14a7CfdNWhdDAolvEiBNfYXs1iGviqVuL7oblpGZfStCsf9vkkGXbjf-fvz2b-gkeaZpiBv41x5ThuExuC-k6Bjd-pH1bjluSf0ZZLEm6L6MKeVyGnYtng_1KvB13c4qv7LLBfvNUg_3tI5cOfwcAAP__tUrl7w">