llvm-project
llvm-project copied to clipboard
Diagnose when an explicit alignment is weakened by other features
This was split off from a comment in #58638:
We might want to open another somewhat similar issue to diagnose when
alignasis weakened by something else:#pragma pack(2) struct D2 { char m1; alignas(8) int m4; }; static_assert(alignof(D2) == 2); // Clang and GCC accept, MSVC and EDG reject
@llvm/issue-subscribers-clang-frontend
Author: Aaron Ballman (AaronBallman)
This was split off from a comment in #58638:
> We might want to open another somewhat similar issue to diagnose when alignas is weakened by something else:
> cpp > #pragma pack(2) > struct D2 { > char m1; > alignas(8) int m4; > }; > > static_assert(alignof(D2) == 2); // Clang and GCC accept, MSVC and EDG reject >
@AaronBallman I've given this an attempt, please let me know if you have any feedback. Thank you