Remove warning on over-wide bit-field of boolean type; there's no risk that
someone thought all the bits would be value bits in this case.
Also fix the wording of the warning -- it claimed that the width of 'bool' is
8, which is not correct; the width is 1 bit, whereas the size is 8 bits in our
implementation.
llvm-svn: 248435
diff --git a/clang/test/CodeGenCXX/warn-padded-packed.cpp b/clang/test/CodeGenCXX/warn-padded-packed.cpp
index f15373e..f2af608 100644
--- a/clang/test/CodeGenCXX/warn-padded-packed.cpp
+++ b/clang/test/CodeGenCXX/warn-padded-packed.cpp
@@ -69,7 +69,7 @@
struct S13 { // expected-warning {{padding size of 'S13' with 6 bits to alignment boundary}}
char c;
- bool b : 10; // expected-warning {{width of bit-field 'b' (10 bits) exceeds the width of its type}}
+ bool b : 10;
};
// The warnings are emitted when the layout of the structs is computed, so we have to use them.
diff --git a/clang/test/SemaCXX/constant-expression-cxx11.cpp b/clang/test/SemaCXX/constant-expression-cxx11.cpp
index ead69fa..794932d 100644
--- a/clang/test/SemaCXX/constant-expression-cxx11.cpp
+++ b/clang/test/SemaCXX/constant-expression-cxx11.cpp
@@ -1801,7 +1801,7 @@
bool b : 1;
unsigned u : 5;
int n : 5;
- bool b2 : 3; // expected-warning {{exceeds the width of its type}}
+ bool b2 : 3;
unsigned u2 : 74; // expected-warning {{exceeds the width of its type}}
int n2 : 81; // expected-warning {{exceeds the width of its type}}
};
diff --git a/clang/test/SemaCXX/ms_wide_bitfield.cpp b/clang/test/SemaCXX/ms_wide_bitfield.cpp
index 3e6a165..b634e78 100644
--- a/clang/test/SemaCXX/ms_wide_bitfield.cpp
+++ b/clang/test/SemaCXX/ms_wide_bitfield.cpp
@@ -1,10 +1,10 @@
// RUN: %clang_cc1 -fno-rtti -emit-llvm-only -triple i686-pc-win32 -fdump-record-layouts -fsyntax-only -mms-bitfields -verify %s 2>&1
struct A {
- char a : 9; // expected-error{{width of bit-field 'a' (9 bits) exceeds width of its type (8 bits)}}
- int b : 33; // expected-error{{width of bit-field 'b' (33 bits) exceeds width of its type (32 bits)}}
- bool c : 9; // expected-error{{width of bit-field 'c' (9 bits) exceeds width of its type (8 bits)}}
- bool d : 3; // expected-warning{{width of bit-field 'd' (3 bits) exceeds the width of its type; value will be truncated to 1 bit}}
+ char a : 9; // expected-error{{width of bit-field 'a' (9 bits) exceeds size of its type (8 bits)}}
+ int b : 33; // expected-error{{width of bit-field 'b' (33 bits) exceeds size of its type (32 bits)}}
+ bool c : 9; // expected-error{{width of bit-field 'c' (9 bits) exceeds size of its type (8 bits)}}
+ bool d : 3;
};
int a[sizeof(A) == 1 ? 1 : -1];