Fix #14371: FP redundantAssignment for nested union members#8748
Open
DanTheMan2000 wants to merge 2 commits into
Open
Fix #14371: FP redundantAssignment for nested union members#8748DanTheMan2000 wants to merge 2 commits into
DanTheMan2000 wants to merge 2 commits into
Conversation
DanTheMan2000
force-pushed
the
fix-14371-union-redundant-assignment
branch
from
July 23, 2026 04:24
c50ae02 to
4761bef
Compare
Author
|
There were actually two variants of this false positive. The one from the ticket involved reading another union member inside a larger expression. The other case is where an assignment to a different union member sits between the two writes to the member being reassigned. Added tests covering both in testother.cpp. |
DanTheMan2000
force-pushed
the
fix-14371-union-redundant-assignment
branch
from
July 23, 2026 04:52
4761bef to
d5f2fb4
Compare
Author
|
Added a couple of control tests to go with the false-positive ones, wanted to make sure the fix is scoped to the actual variable being reassigned. |
Collaborator
|
Thanks for your contribution. |
The separate #14371 tests all used the same union definition, so combine them into one test case containing multiple functions as requested in review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.