From: Chris Lattner Date: Fri, 20 Jul 2007 18:13:33 +0000 (+0000) Subject: fix a nasty bug Owen noticed in a gcc warning. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1c2df99ba67ec6c29ac7dceaa4eb2c8cda4a017;p=clang fix a nasty bug Owen noticed in a gcc warning. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40110 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp index 0de2d5e4e6..29057b491f 100644 --- a/AST/ASTContext.cpp +++ b/AST/ASTContext.cpp @@ -160,18 +160,18 @@ ASTContext::getTypeInfo(QualType T, SourceLocation L) { case Type::TypeName: assert(0 && "Not a canonical type!"); case Type::FunctionNoProto: case Type::FunctionProto: - assert(0 && "Incomplete types have no size!"); default: + assert(0 && "Incomplete types have no size!"); case Type::Array: { std::pair EltInfo = getTypeInfo(cast(T)->getElementType(), L); // Get the size of the array. - llvm::APSInt Size(32); - if (!cast(T)->getSizeExpr()->isIntegerConstantExpr(Size, *this)) + llvm::APSInt Sz(32); + if (!cast(T)->getSizeExpr()->isIntegerConstantExpr(Sz, *this)) assert(0 && "VLAs not implemented yet!"); - Size = EltInfo.first*Size.getZExtValue(); + Size = EltInfo.first*Sz.getZExtValue(); Align = EltInfo.second; break; }