[clang] [clang][NFC] Specify Type and ExtQuals as having 16-byte alignment (PR #68377)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 6 05:50:46 PDT 2023


================
@@ -1507,6 +1508,9 @@ class ExtQuals : public ExtQualsTypeCommonBase, public llvm::FoldingSetNode {
       : ExtQualsTypeCommonBase(baseType,
                                canon.isNull() ? QualType(this_(), 0) : canon),
         Quals(quals) {
+    static_assert(alignof(decltype(*this)) % TypeAlignment == 0,
----------------
AaronBallman wrote:

This feels unnecessary because we've added `alignas(TypeAlignment)` to the class -- it's basically statically asserting that the compiler honored the alignment we requested (which it has to do anyway or else the program is ill-formed), WDYT?

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


More information about the cfe-commits mailing list