From: Chris Lattner Date: Thu, 23 Aug 2007 21:58:08 +0000 (+0000) Subject: fix a bug where we would type 0ULL as unsigned instead of unsigned long long X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=97c5156897e52a74d77724aaf48638ca2b1fc63c;p=clang fix a bug where we would type 0ULL as unsigned instead of unsigned long long git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41340 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 6d5d852719..f6d00070c4 100644 --- a/Sema/SemaExpr.cpp +++ b/Sema/SemaExpr.cpp @@ -162,7 +162,8 @@ Action::ExprResult Sema::ParseNumericConstant(const Token &Tok) { bool AllowUnsigned = Literal.isUnsigned || Literal.getRadix() != 10; // Check from smallest to largest, picking the smallest type we can. - if (!Literal.isLong) { // Are int/unsigned possibilities? + if (!Literal.isLong && !Literal.isLongLong) { + // Are int/unsigned possibilities? unsigned IntSize = Context.getTypeSize(Context.IntTy,Tok.getLocation()); // Does it fit in a unsigned int? if (ResultVal.isIntN(IntSize)) {