[PATCH] D133711: [Sema] Reject array element types whose alignments are larger than their sizes

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 13:46:05 PDT 2022


efriedma added a comment.

> It looks like gcc started rejecting the code relatively recently (11.1).

On what example?  The code in the commit message gives an error on gcc 5.

> Also, I found out that MSVC doesn't reject the following code:

This looks like a backwards-compatibility quirk in the 32-bit x86 MSVC ABI; other MSVC targets round up the size, and even adding `__declspec(align(1))` forces the size to something sane.  Don't know if we want to try to emulate this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133711/new/

https://reviews.llvm.org/D133711



More information about the cfe-commits mailing list