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

    <tr>
        <th>Summary</th>
        <td>
            Unsupported `constexpr std::bit_cast` for `std::complex`
        </td>
    </tr>

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

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

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

<pre>
    Hello, I am trying to bit_cast a structure containing `std::complex`, and clang is reporting that this is unsupported. I'm attaching here an MVE:
```
#include <bit>
#include <iostream>
#include <complex>
#include <array>

using C = std::complex<double>;

int main() {
    constexpr unsigned char data[sizeof(C)] = {0};

    constexpr C c = std::bit_cast<C>(data);
 std::cout << c << '\n';

    return 0;
}
```
This seems to fail on trunk as per godbolt (https://godbolt.org/z/q8fKE7r18).

There exists a similar issue, #54018, which involves bit-fields. I am not sure whether this is related at low level, but I think enabling `std::bit_cast` on a "native" standard library type is quite important. I am opening this issue as I have not been able to find any status reports on this problem.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VMFu4zYQ_Rr6MoghU5YlHXRI5BgNip667bUYiSOLXYrUkkMnztcvKCdxNpsAhmVryDeP770hhqCPlqgRxZ0o9iuMPDrf_H1C4_wz2VXn1Ln5g4xxQrbwADgB-7O2R2AHneb_egwMCIF97Dl6gt5ZRm3TErHLAiuR34r8tnfTbOhJ7LIEhFZBb9AeQQfwNDvPC-aIDDzqkF5HG-KcKqTW8CBkOQEyYz-mlSN5ArTw17_3CT_bi-w2YV8-l78y17Y3URGIvO00i_z-s4p2gT3h9EX5lfjnVfQez9fa8h1DYtiCyPfw2_nzVrnYGUp78rv327RlmFBbISshaxDlSxUAkqiB6Wn2SZXkmIJ-RA8KGUVxF_QzuUHIqhWyFsV-aS3Ku0yU-w9dfkVrof-V5qulIm_bRFFWSwtZv8G8P1LkpIHILzDLDyFLUbQ2PX5v7Imjt5BdS-X-U---pQwEoimknA2oDTgL7KP9DhhgJg9HpzpnGISsRuY5JE7yIOThpbB2_ijk4VnIw49q-PO-9Juk6_o9p29LjOhJBw4pxHrSBj3oECKlmAqZF9ss7WvhcdT9CNqenDlRSNm_GTQZFdaXsbCOIaQBeByJR_JvOfZkkEkBMhj3CIZOZBJgFxke0ir7HchiZz6OzJsXuyydHkFIaZH1iYSUEBitQq_A6M6jPwOfZ0r9fkTNBHpKo4OWX-i5mexlxBZWIVIS8gFGPNHCvSOygJ2hRXFtFaA9py4cX0c0LCYkgNm7ztC0XqkmV3Ve44qaTbkpd9WmquRqbCpFRVHWZZkNCjcFbcuh6-pcqmzbyx1VK93ITG6zXbbb5MVGynWvhkHWVNcyz_Kh3oltRhNqszbmNCUzVwvrpt7uZLYy2JEJy7UlpaXHV89kusV8k_bcdPEYxDYzyd0rCms21PxzvVyS5teJ-FT9wfkvLrNV9Kb5kD_NY-zWvZuEPKS2L4-b2bv_qWchDwvZIOThcphTI38GAAD__0jUuEY">