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

    <tr>
        <th>Summary</th>
        <td>
            offsetof() is not constant in clang-cl
        </td>
    </tr>

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

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

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

<pre>
    I use offsetof in a template parameter, this works on all compilers (clang, MSVC, gcc) except clang-cl.

```
error: non-type template argument is not a constant expression

C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stddef.h(47,31): note: 
 expanded from macro 'offsetof'
  ...offsetof(s,m) ((::size_t)&reinterpret_cast<char const volatile&>((((s*)0)->m)))    
 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
```

Obviously reinterpret_cast is not constant evaluable. So I guess MSVC provides a builtin, but clang-cl does not?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU8GOpDYQ_ZriUmoEZaDhwKHDTkujKEqklZLjym0K2rvGRrbpmckh3x6Z6UmvVrktKrlkyn5-rvcsQ9CzZe6h_gXqT5nc4tX5fpRWfvuaXdz41j_jFhjdNAWObkJtUWLkZTUyMq7Sy4Uje6AB41UHfHH-W0BnURqDyi2rNuwDArXKSDundb99_nNIeVYKqEN-VbxG3MsHZXIoPkFxuo9NcY99yt47D-KE1tlDfFv5wUT6eVvYRtQBrYsoUTkborQR-XX1HIJ29nvoAcQJ6uEP72YvFzxrwzvN17YB6qAe_tJ2dC8Bf9UxQD2UBdTDs1VmG3mf5kVedkVV5qmwKR-hHkIcR57yK1BbHYEGUSasnXDklN_PTpSkHXnEybsFF6m8Q6DjR5eBjveFmOf5428bgIYlNQ2oTSFOIE5B_81fYjqIGs_aRvar5_hFyRBBDOoq_Xsz8OaMjNowUAPi6Y6xRwA6AXUFUHcA8bTsaCkQ8YM01E___OSH_yvr-_j75abdFswb_niJD00fit6k2eTFcI6fHT7jvHEIu69w9e6mRw4o8bJpE7VNVrtsD4Ph6HjHA3HOxl6Mnehkxn3ZHMu2akVbZNee6CiVLKq2FFNZjWVTKi5rIqW6muquzHRPBVFJVBVUdlWRCzGNx07UTS0m2TQNVAUvUpvcmNuSOz9nOoSN-7pr2i4z8sIm7M-OyPIL7kUgSq_Q92nP4bLNAarC6BDDAyXqaLj_zhNJpB8bpO1_1802b_prjGtIbqEz0HnW8bpdcuUWoHMCvqfD6t1XVhHovNMJQOed7r8BAAD__-9KU18">