Contributor 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.
Contributor 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.
As far as I see, the added tests all use the same union definition. Can you consolidate them into one test case containing multiple functions?
The separate #14371 tests all used the same union definition, so combine them into one test case containing multiple functions as requested in review.
Collaborator
If you wish, you can add yourself to the AUTHORS file. Please add [skip ci] in the commit message.
Contributor Author
If you wish, you can add yourself to the AUTHORS file. Please add
[skip ci]in the commit message.
I don't think that's necessary. Thanks!