Commit f9785e4
committed
[Clang][C++20] Implement constexpr std::bit_cast for bit-fields
After this commit, clang permits constructions like:
```c++
struct bits {
unsigned char : 7;
unsigned char flag : 1;
}
static_assert(std::bit_cast<bits>(0x80).flag); // succeeds on little-endian systems
```
This change builds on the prior work in https://reviews.llvm.org/D628251 parent f281d34 commit f9785e4
File tree
4 files changed
+690
-117
lines changed- clang
- include/clang/Basic
- lib/AST
- test
- SemaCXX
- SemaTemplate
4 files changed
+690
-117
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
319 | 323 | | |
320 | 324 | | |
321 | | - | |
322 | | - | |
| 325 | + | |
| 326 | + | |
323 | 327 | | |
324 | 328 | | |
325 | 329 | | |
| |||
0 commit comments