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

    <tr>
        <th>Summary</th>
        <td>
            CUDA Shared Variable with Non-empty compile time Constructor
        </td>
    </tr>

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

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

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

<pre>
    I understand that shared variables shouldn't have actual constructors and not treating this as an error is potentially dangerous. However, the use case where the constructor only lives in compile time should be allowed (e.g. using only `static_assert` in constructors). Such use case exists when bridging with some libraries' generic code across device and host (e.g. Eigen). Currently, `clang` emits an error whenever the constructor is non-empty, and it might not be very reasonable for this case. I'm wondering if this feature can be implemented.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxlUsFu2zAM_Rr7QtRwbcdODz606Yr1MmAotusgW4zNQZYCiUqWvx_lNEuLAYYNkn6Pj48cnD73rxCtRh9YWQ08K4YwK48ajsqTGgwGSbhotM2qjmFWRwQ1clQGRmcD-ziy8wES3DoG9qiY7CRcJNlUAPTeeZDw4BgtkzLmDFrZCb2LoYCv7oRH9Fm1ExRCDAijktdpRo9r6kMrcFbQho6ijKxUlgMZ-YsWfFcKg0g0Rkg1ZNUWi6kQzqRphWZtKdMyjb9UCOhZ4gvRbZqseijgLY7zTQv-ocAhSbIweNJT4jsRzxCcdDY0eDEMBdrBhBY9jUKpk1nehQAajzTiatPsAv8T9oXk77XfLnov7phz8kFEjUYcSuJwIf7gY5KQ7PrPGDHYOnuHy4FXjtSLGBaaZl53I74I7gyyouBsWi7snb9sKg1ZwKvIX-Dk0kmkAWl_qe5lqdEnK2xioeVgcBGxqItc97V-qB9UzsQG-92P50d4u9zQz_cbuhj17Sru89J2txHy6E0_Mx9CVj9m1Ys8kyDjUAhCAmOO18_dwbvfOLKEFEJMxr9s2qqu87lvm7rcN7jftkO97XRbY1d1TdkNY620JHOjBjShzzZP2eY5p74qq6psq_a-Kzd1U6j7utpsy7prcWhUN2ZNiYsiU6TGhfNT7vtVwxCnIEWTTuNWlLOiySJe-VXk2fn-ieys3Hey-Sq4X9X-BaRDOTo">