[clang] [Clang] Fix oversized bit-field layout on big-endian targets (PR #225494)
Victor Campos via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 29 03:27:05 PDT 2026
================
@@ -15917,12 +15917,15 @@ struct PaddingCalculator {
const uint64_t DeclaredSizeInBits = Field->getBitWidthValue();
- // Handle over-sized bitfields:
- // unsigned char a : 12;
- // In this case, DeclaredSizeInBits is 12, but the actually occupied bit
- // size is 8, while the remaining 4 bits are padding.
+ // Oversized bit-fields (declared width larger than the field type) keep
+ // only the type's width as the value container. The extra declared bits
+ // are padding and follow that container (Itanium C++ ABI 2.4).
----------------
vhscampos wrote:
Hi, this is still unresolved. Can you add the entire reference?
https://github.com/llvm/llvm-project/pull/225494
More information about the cfe-commits
mailing list