From 9c0f53a0b48126eae12daf453c9d39af79232a24 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Thu, 13 Apr 2017 16:34:49 +0000 Subject: [PATCH] [APSInt] Add a static_assert to ensure APSInt is packed well with APInt after r300171. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300213 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APSInt.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/llvm/ADT/APSInt.h b/include/llvm/ADT/APSInt.h index 813b3686d6b..865af2db2a0 100644 --- a/include/llvm/ADT/APSInt.h +++ b/include/llvm/ADT/APSInt.h @@ -24,7 +24,9 @@ class LLVM_NODISCARD APSInt : public APInt { public: /// Default constructor that creates an uninitialized APInt. - explicit APSInt() : IsUnsigned(false) {} + explicit APSInt() : IsUnsigned(false) { + static_assert(sizeof(*this) == 16, "APSInt fields poorly packed"); + } /// APSInt ctor - Create an APSInt with the specified width, default to /// unsigned. -- 2.50.1