[clang] [clang][analyzer] Ignore unnamed bitfields in UninitializedObject (PR #132427)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 21 13:24:25 PDT 2025
steakhal wrote:
We only accept patches with regressions tests, that ensure that in the future we never accidentally break one thing we had broken in the past. This ensures we are heading in the right direction.
Here are two examples I grabbed from the history of this particular checker:
- https://github.com/llvm/llvm-project/commit/4ff7769974614a0c4ef576ffa0ab46a58bb3fef4
- https://github.com/llvm/llvm-project/commit/f0dd1016da7bb4a84f099182a0fae9895c280512
You can see whenever we have a semantic change (aka. not just a refactor) we almost always have a test demonstrating the changed behavior. Have a look at what test files we usually use for this checker, select the "most suitable place" and extend it with the new test case. Remember to add `// expected-warning {{...}}` comment where relevant to mandate some output.
We usually also put a `no-warning` comment at some places where we had a diagnostic in the past and we have just fixed it. (This is your case).
https://github.com/llvm/llvm-project/pull/132427
More information about the cfe-commits
mailing list