=?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>,Theo de Magalhaes <theodemagalh...@icloud.com>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr>, =?utf-8?q?Théo?= De Magalhaes <theo.de-magalh...@epita.fr> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/134...@github.com>
================ @@ -3231,6 +3259,22 @@ void MicrosoftRecordLayoutBuilder::finalizeLayout(const RecordDecl *RD) { Size = Context.toCharUnitsFromBits(External.Size); if (External.Align) Alignment = Context.toCharUnitsFromBits(External.Align); + return; + } + unsigned CharBitNum = Context.getTargetInfo().getCharWidth(); + uint64_t DataSizeInBits = Context.toBits(DataSize); ---------------- theomagellan wrote: You were right, using DataSize did create issues while using certain alignment attributes. I added some in the test file. Now, 1 byte is artificially added to `UnpaddedSizeInBits` when `Size` is zero before aligning the empty struct to its alignment. This allows to keep the checks as they used to be (using Size instead of DataSize) and also takes care of the empty struct case. Thank you for catching that case! https://github.com/llvm/llvm-project/pull/134426 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits