[clang] [Clang][Windows] Preserve natural alignment for vector and x86_fp80 arrays under #pragma pack. (PR #208256)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 9 06:06:13 PDT 2026


================
@@ -195,7 +199,8 @@ struct TypeInfo {
            AlignRequirementKind AlignRequirement)
       : Width(Width), Align(Align), AlignRequirement(AlignRequirement) {}
   bool isAlignRequired() {
-    return AlignRequirement != AlignRequirementKind::None;
+    return AlignRequirement != AlignRequirementKind::None &&
----------------
zahiraam wrote:

It's `RequiredByTypedef`: the `typedef`'s aligned attribute overrides `ResistPragmaPack`, so the field gets `32-byte` alignment regardless of `#pragma pack`, same as before this patch. I added tests for this and related `typedef` cases.

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


More information about the cfe-commits mailing list