summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-05-14 23:41:50 +0000
committerRichard Trieu <rtrieu@google.com>2013-05-14 23:41:50 +0000
commit1069b731a0dc872069c2d6572eefe424b0cceff3 (patch)
treea5da87feb0844b640e7168f52239b3bb4b45aa22
parent9f00b1d3962147a2fe049b8b45f70680bc12fbc1 (diff)
downloadclang-1069b731a0dc872069c2d6572eefe424b0cceff3.tar.gz
clang-1069b731a0dc872069c2d6572eefe424b0cceff3.tar.bz2
clang-1069b731a0dc872069c2d6572eefe424b0cceff3.tar.xz
Add static_cast to assertion to silence sign/unsigned comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181849 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ASTContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index c385d6cf3a..b19150f048 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -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();