[clang] fix: C++ empty record with align lead to va_list out of sync (PR #72197)

via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 3 19:36:44 PST 2023


hstk30-hw wrote:

I guess the `i8` is from https://github.com/ARM-software/abi-aa/blob/2a70c42d62e9c3eb5887fa50b71257f20daca6f9/cppabi64/cppabi64.rst#41summary-of-differences-from-and-additions-to-the-generic-c-abi

> The GC++ABI defines the way in which empty class types are laid out. For the purposes of parameter passing in [[AAPCS64](https://github.com/ARM-software/abi-aa/releases)], a parameter whose type is an empty class shall be treated as if its type were an aggregate with a single member of type unsigned byte.

and in [gcppabi](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#empty-parameters)

> Arguments of empty class types that are not non-trivial for the purposes of calls are passed no differently from ordinary classes.

I guess I should fix in `va_arg` instead of `classifyArgumentType`, right? @rjmccall 

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


More information about the cfe-commits mailing list