]> granicus.if.org Git - clang/commitdiff
__uint128_t is indeed an unsigned integer type. Fixes PR5435.
authorAnders Carlsson <andersca@mac.com>
Mon, 9 Nov 2009 17:34:18 +0000 (17:34 +0000)
committerAnders Carlsson <andersca@mac.com>
Mon, 9 Nov 2009 17:34:18 +0000 (17:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/Type.cpp
test/Sema/128bitint.c

index e9ce8305744dbf131b16efa8138affc6f3d37a06..ae78b89e4b7facb316b86c7037b6d185c1829fd2 100644 (file)
@@ -425,7 +425,7 @@ bool Type::isSignedIntegerType() const {
 bool Type::isUnsignedIntegerType() const {
   if (const BuiltinType *BT = dyn_cast<BuiltinType>(CanonicalType)) {
     return BT->getKind() >= BuiltinType::Bool &&
-           BT->getKind() <= BuiltinType::ULongLong;
+           BT->getKind() <= BuiltinType::UInt128;
   }
 
   if (const EnumType *ET = dyn_cast<EnumType>(CanonicalType))
index 2a18d904f8f273518478bcc4a86510070e7088a7..b97238d05daeea4b70962b787d99b901768cbe56 100644 (file)
@@ -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;