-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Closed
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"
Description
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, with PR #74775, 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.
danra
Metadata
Metadata
Assignees
Labels
clang:frontendLanguage frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"