]> granicus.if.org Git - clang/commitdiff
Add static_cast to assertion to silence sign/unsigned comparison warning.
authorRichard Trieu <rtrieu@google.com>
Tue, 14 May 2013 23:41:50 +0000 (23:41 +0000)
committerRichard Trieu <rtrieu@google.com>
Tue, 14 May 2013 23:41:50 +0000 (23:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181849 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTContext.cpp

index c385d6cf3a3a8e42220511a0439af047220aa1ee..b19150f0485b1d3ca2d2d2c6eb3272900050b91f 100644 (file)
@@ -1353,7 +1353,8 @@ static getConstantArrayInfoInChars(const ASTContext &Context,
   std::pair<CharUnits, CharUnits> EltInfo =
       Context.getTypeInfoInChars(CAT->getElementType());
   uint64_t Size = CAT->getSize().getZExtValue();
-  assert((Size == 0 || EltInfo.first.getQuantity() <= (uint64_t)(-1)/Size) &&
+  assert((Size == 0 || static_cast<uint64_t>(EltInfo.first.getQuantity()) <=
+              (uint64_t)(-1)/Size) &&
          "Overflow in array type char size evaluation");
   uint64_t Width = EltInfo.first.getQuantity() * Size;
   unsigned Align = EltInfo.second.getQuantity();