[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-09-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/constant-conversion.c:30 + s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1}} + s.b = true; // no-warning (we suppress it manually to reduce

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-09-02 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added inline comments. Comment at: clang/test/Sema/constant-conversion.c:30 + s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1}} + s.b = true; // no-warning (we suppress it manually to reduce false

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-09-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/constant-conversion.c:30 + s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1}} + s.b = true; // no-warning (we suppress it manually to reduce

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-09-01 Thread Bjorn Pettersson via Phabricator via cfe-commits
bjope added inline comments. Comment at: clang/test/Sema/constant-conversion.c:30 + s.b = 1; // one-bit-warning {{implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1}} + s.b = true; // no-warning (we suppress it manually to reduce false

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-31 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3b00e486797c: Further update -Wbitfield-constant-conversion for 1-bit bitfield (authored by aaron.ballman). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision. erichkeane added a comment. Still LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132851/new/ https://reviews.llvm.org/D132851 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 456366. aaron.ballman added a comment. Update based on review feedback. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132851/new/ https://reviews.llvm.org/D132851 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticGrou

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Erich Keane via Phabricator via cfe-commits
erichkeane accepted this revision. erichkeane added a comment. This revision is now accepted and ready to land. 2 nits, otherwise LGTM. Comment at: clang/lib/Sema/SemaChecking.cpp:13080 - S.Diag(InitLoc, diag::warn_impcast_bitfield_precision_constant) -<< PrettyValue <<

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman updated this revision to Diff 456343. aaron.ballman added a comment. Added a test case for `true` in C++, and added similar logic for C to reduce the chance for false positives. If the user uses `true` (the macro from stdbool.h), they're signaling an intent that the field is used i

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. LGTM, questioning whether we want to do some macro introspection in C mode (as the CORRECT way to use these 1 bit-bitfields is as a bool), but at least this gives the person the ability to disable this warning. Comment at: clang/test/Sema/constant-

[PATCH] D132851: Further update -Wbitfield-constant-conversion for 1-bit bitfield

2022-08-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman created this revision. aaron.ballman added reviewers: ShawnZhong, thakis, clang-language-wg, erichkeane. Herald added a project: All. aaron.ballman requested review of this revision. Herald added a project: clang. https://reviews.llvm.org/D131255 (82afc9b169a67e8b8a1862fb9c41a2cd974