]> granicus.if.org Git - llvm/commitdiff
[LLVM][Alignment] Fix MSVC potential division by 0 warning (PR42911)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Aug 2019 16:34:23 +0000 (16:34 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Aug 2019 16:34:23 +0000 (16:34 +0000)
Original Patch by @gchatelet (Guillaume Chatelet)

Differential Revision: https://reviews.llvm.org/D65859

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369016 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/AlignmentTest.cpp

index 83d6a727721b122d0b8e6d42501496ef61a42984..420772541d4a58c2168f1b0f3082cfd9a1877f9a 100644 (file)
 
 #include <vector>
 
+#ifdef _MSC_VER
+// Disable warnings about potential divide by 0.
+#pragma warning(push)
+#pragma warning(disable : 4723)
+#endif
+
 using namespace llvm;
 
 namespace {
@@ -298,3 +304,7 @@ TEST(AlignmentDeathTest, CompareAlignToUndefMaybeAlign) {
 #endif // NDEBUG
 
 } // end anonymous namespace
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif