diff options
author | Shawn Zhong <github@shawnzhong.com> | 2022-08-09 11:42:39 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2022-08-09 11:43:50 -0400 |
commit | 82afc9b169a67e8b8a1862fb9c41a2cd974d6691 (patch) | |
tree | fc3c870ed813a9fe5d33dd153628ab290e5ff37e /clang/test/Rewriter | |
parent | e486e48c3d9e99e4c17d365bbc4b429c8e5b5999 (diff) | |
download | llvm-82afc9b169a67e8b8a1862fb9c41a2cd974d6691.zip llvm-82afc9b169a67e8b8a1862fb9c41a2cd974d6691.tar.gz llvm-82afc9b169a67e8b8a1862fb9c41a2cd974d6691.tar.bz2 |
Fix -Wbitfield-constant-conversion on 1-bit signed bitfield
A one-bit signed bit-field can only hold the values 0 and -1; this
corrects the diagnostic behavior accordingly.
Fixes #53253
Differential Revision: https://reviews.llvm.org/D131255
Diffstat (limited to 'clang/test/Rewriter')
-rw-r--r-- | clang/test/Rewriter/rewrite-modern-struct-ivar-1.mm | 2 | ||||
-rw-r--r-- | clang/test/Rewriter/rewrite-modern-struct-ivar.mm | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/Rewriter/rewrite-modern-struct-ivar-1.mm b/clang/test/Rewriter/rewrite-modern-struct-ivar-1.mm index a17fe3f..e54b1cd 100644 --- a/clang/test/Rewriter/rewrite-modern-struct-ivar-1.mm +++ b/clang/test/Rewriter/rewrite-modern-struct-ivar-1.mm @@ -34,7 +34,7 @@ typedef struct { @implementation Foo - (void)x:(Foo *)other { bar.x = 0; - bar.y = 1; + bar.y = -1; self->_internal._singleRange._range = (( other ->bar.x) ? &( other ->_internal._singleRange._range) : ((NSRange *)(&(((_NSRangeInfo *)( other ->_internal._multipleRanges._data))->_ranges))))[0]; } @end diff --git a/clang/test/Rewriter/rewrite-modern-struct-ivar.mm b/clang/test/Rewriter/rewrite-modern-struct-ivar.mm index 9f56cd8..f98bdbc 100644 --- a/clang/test/Rewriter/rewrite-modern-struct-ivar.mm +++ b/clang/test/Rewriter/rewrite-modern-struct-ivar.mm @@ -41,10 +41,10 @@ struct S { @implementation Foo - (void)x { bar.x = 0; - bar.y = 1; + bar.y = -1; s.x = 0; - s.y = 1; + s.y = -1; } @end |