Remove -Wpacked false positive for non-pod types where the layout isn't directly...
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 25 Apr 2023 20:01:43 +0000 (20:01 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 9 May 2023 00:13:45 +0000 (00:13 +0000)
commita8b0c6fa28acced71db33e80bd0b51d00422035b
tree324c6648c6e9b0601550c37e7fffca5c4244cbf1
parent971d982bd45c3c3544dcf8d1e67df39e8c063877
Remove -Wpacked false positive for non-pod types where the layout isn't directly changed

The packed attribute can still be useful in this case if the struct is
then placed inside another packed struct - the non-pod element type's
packed attribute declares that it's OK to misalign this element inside
the packed structure. (otherwise the non-pod element is not packed/its
alignment is preserved, as per D117616/2771233)

Fixes PR62353

Differential Revision: https://reviews.llvm.org/D149182
clang/docs/ReleaseNotes.rst
clang/lib/AST/RecordLayoutBuilder.cpp
clang/test/CodeGenCXX/warn-padded-packed.cpp
clang/test/Layout/aix-Wpacked-expecting-diagnostics.cpp