From: Richard Trieu Date: Tue, 14 May 2013 23:41:50 +0000 (+0000) Subject: Add static_cast to assertion to silence sign/unsigned comparison warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1069b731a0dc872069c2d6572eefe424b0cceff3;p=clang 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 --- 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 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(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();