[clang] [ARM, AArch64] Fix passing of structures with aligned base classes (PR #135564)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 14 13:01:03 PDT 2025


================
@@ -1302,6 +1302,7 @@ ItaniumRecordLayoutBuilder::LayoutBase(const BaseSubobjectInfo *Base) {
     setSize(std::max(getSize(), Offset + Layout.getSize()));
 
   // Remember max struct/class alignment.
+  UnadjustedAlignment = std::max(UnadjustedAlignment, PreferredBaseAlign);
----------------
efriedma-quic wrote:

If other compilers agree, maybe it's not high-priority to update the spec... but it would be nice to have an explicit statement somewhere.

----

I was remembering that other targets have preferred alignment, but I guess on non-AIX targets that's only a thing outside of record layout.  But for clarity, please do fix it so it doesn't interact with preferred alignment stuff.

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


More information about the cfe-commits mailing list