Check signedness of bitfield sizes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67045 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 51b2b85..d34a8e7 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3363,7 +3363,7 @@
   if (Value == 0 && FieldName)
     return Diag(FieldLoc, diag::err_bitfield_has_zero_width) << FieldName;
   
-  if (Value.isNegative())
+  if (Value.isSigned() && Value.isNegative())
     return Diag(FieldLoc, diag::err_bitfield_has_negative_width) 
              << FieldName << Value.toString(10);
 
diff --git a/test/Sema/bitfield.c b/test/Sema/bitfield.c
index 7a70fe8..0a658c5 100644
--- a/test/Sema/bitfield.c
+++ b/test/Sema/bitfield.c
@@ -17,5 +17,7 @@
 
   // PR3607
   enum e0 f : 1; // expected-error {{field has incomplete type 'enum e0'}}
+  
+  int g : (_Bool)1;
 };