r181849 - Add static_cast to assertion to silence sign/unsigned comparison warning.
Richard Trieu
rtrieu at google.com
Tue May 14 16:41:50 PDT 2013
Author: rtrieu
Date: Tue May 14 18:41:50 2013
New Revision: 181849
URL: http://llvm.org/viewvc/llvm-project?rev=181849&view=rev
Log:
Add static_cast to assertion to silence sign/unsigned comparison warning.
Modified:
cfe/trunk/lib/AST/ASTContext.cpp
Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=181849&r1=181848&r2=181849&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Tue May 14 18:41:50 2013
@@ -1353,7 +1353,8 @@ static getConstantArrayInfoInChars(const
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();
More information about the cfe-commits
mailing list