aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Rewriter
diff options
context:
space:
mode:
authorShawn Zhong <github@shawnzhong.com>2022-08-09 11:42:39 -0400
committerAaron Ballman <aaron@aaronballman.com>2022-08-09 11:43:50 -0400
commit82afc9b169a67e8b8a1862fb9c41a2cd974d6691 (patch)
treefc3c870ed813a9fe5d33dd153628ab290e5ff37e /clang/test/Rewriter
parente486e48c3d9e99e4c17d365bbc4b429c8e5b5999 (diff)
downloadllvm-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.mm2
-rw-r--r--clang/test/Rewriter/rewrite-modern-struct-ivar.mm4
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