diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Sema/switch.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Sema/switch.c b/clang/test/Sema/switch.c index 638fd997679..f704c886c96 100644 --- a/clang/test/Sema/switch.c +++ b/clang/test/Sema/switch.c @@ -283,6 +283,10 @@ void test16() { } } +struct bitfield_member { + unsigned bf : 1; +}; + // PR7359 void test17(int x) { switch (x >= 17) { // expected-warning {{switch condition has boolean value}} @@ -292,6 +296,13 @@ void test17(int x) { switch ((int) (x <= 17)) { case 0: return; } + + struct bitfield_member bm; + switch (bm.bf) { // no warning + case 0: + case 1: + return; + } } int test18() { |