[clang-tools-extra] [clangd] Show alignment for records and fields decls (PR #67213)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 21 08:29:08 PDT 2023


Endilll wrote:

On the topic of ABI, Itanium and Microsoft type layouts are not compatible, even for standard-layout (POD) types. For [example](https://godbolt.org/z/zxfvMa9nE), bit-fields are [allowed](http://eel.is/c++draft/class.prop#3) in standard-layout types, but only Microsoft ABI mandates that bit-fields of different types can't be combined, and have to be padded. That's why almost all bit-fields in Clang are `unsigned`, without regards to types of values they hold. So author did the right thing asking Clang for alignment of types. 

Triviality is another aspect of what has been known as POD, and has nothing to do with layouts: http://eel.is/c++draft/class.prop#2

https://github.com/llvm/llvm-project/pull/67213


More information about the cfe-commits mailing list