diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-12-15 02:41:52 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-12-15 02:41:52 +0000 |
commit | b17ee5bff0d7986c14cdddb279e0131bd7f9678d (patch) | |
tree | f2a0c32e9629117fbed04d463fad1e520a7b038e /test/Sema/compare.c | |
parent | 2135ebb83179ee87910afdebc1bc091e17a7d1eb (diff) | |
download | clang-b17ee5bff0d7986c14cdddb279e0131bd7f9678d.tar.gz |
Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield. PR11572.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146634 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/compare.c')
-rw-r--r-- | test/Sema/compare.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/compare.c b/test/Sema/compare.c index cd973d4885..03aebb3a04 100644 --- a/test/Sema/compare.c +++ b/test/Sema/compare.c @@ -327,3 +327,9 @@ void test10(void) { b = (si == (ui = sl)); // expected-warning {{comparison of integers of different signs: 'int' and 'unsigned int'}} b = (si == (ui = sl&15)); } + +// PR11572 +struct test11S { unsigned x : 30; }; +int test11(unsigned y, struct test11S *p) { + return y > (p->x >> 24); // no-warning +} |