]> granicus.if.org Git - clang/commitdiff
Hopefully the last of the APSInt signedness issues with initializers. Fixes PR clang...
authorDouglas Gregor <dgregor@apple.com>
Fri, 23 Jan 2009 21:04:18 +0000 (21:04 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 23 Jan 2009 21:04:18 +0000 (21:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62876 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaInit.cpp
test/Sema/designated-initializers.c

index aff46ef61d501760412cf42e9e401aae771b0a72..15e2d5d13f2f73b9303dc9f3c693f6bf34463069 100644 (file)
@@ -626,6 +626,7 @@ CheckArrayDesignatorExpr(Sema &Self, Expr *Index, llvm::APSInt &Value) {
     return Self.Diag(Loc, diag::err_array_designator_negative)
       << Value.toString(10) << Index->getSourceRange();
 
+  Value.setIsUnsigned(true);
   return false;
 }
 
index 3fe5f8484c2df5eed180c36729858d90ddfce4fd..8f7eb8cda92809c9962abcf1519eeefe0c2b2ae7 100644 (file)
@@ -113,6 +113,7 @@ struct disklabel_ops disklabel64_ops = {
   .labelsize = sizeof(struct disklabel_ops)
 };
 
-// PR clang/3377
+// PR clang/3378
 int bitwidth[] = { [(long long int)1] = 5, [(short int)2] = 2 };
 int a[]= { [sizeof(int)] = 0 };
+int a2[]= { [0 ... sizeof(int)] = 0 };