Recommit r235219, it's need for out-of-tree users of AlignOf.h.
authorYaron Keren <yaron.keren@gmail.com>
Wed, 22 Apr 2015 16:43:56 +0000 (16:43 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Wed, 22 Apr 2015 16:43:56 +0000 (16:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235522 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/AlignOf.h

index 061d5acf2322b570ad197b753db150d10c2f1b4b..f564fd353d8c7ded57db5fbd03cd8411d1f4fc87 100644 (file)
@@ -22,6 +22,14 @@ namespace llvm {
 template <typename T>
 struct AlignmentCalcImpl {
   char x;
+#if defined(_MSC_VER)
+// Disables "structure was padded due to __declspec(align())" warnings that are
+// generated by any class using AlignOf<T> with a manually specified alignment.
+// Although the warning is disabled in the LLVM project we need this pragma 
+// as AlignOf.h is a published support header that's available for use
+// out-of-tree, and we would like that to ompile cleanly at /W4.
+#pragma warning(suppress : 4324)
+#endif
   T t;
 private:
   AlignmentCalcImpl() {} // Never instantiate.