From: Anders Carlsson Date: Mon, 9 Nov 2009 17:34:18 +0000 (+0000) Subject: __uint128_t is indeed an unsigned integer type. Fixes PR5435. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1c03ca30ae962199ef702324b48550f6af7fdc32;p=clang __uint128_t is indeed an unsigned integer type. Fixes PR5435. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index e9ce830574..ae78b89e4b 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -425,7 +425,7 @@ bool Type::isSignedIntegerType() const { bool Type::isUnsignedIntegerType() const { if (const BuiltinType *BT = dyn_cast(CanonicalType)) { return BT->getKind() >= BuiltinType::Bool && - BT->getKind() <= BuiltinType::ULongLong; + BT->getKind() <= BuiltinType::UInt128; } if (const EnumType *ET = dyn_cast(CanonicalType)) diff --git a/test/Sema/128bitint.c b/test/Sema/128bitint.c index 2a18d904f8..b97238d05d 100644 --- a/test/Sema/128bitint.c +++ b/test/Sema/128bitint.c @@ -4,3 +4,6 @@ typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; + +// PR5435 +__uint128_t b = (__uint128_t)-1;