[clang-tidy] Correctly handle evaluation order of designated initializers.
authorMartin Braenne <mboehme@google.com>
Thu, 16 Mar 2023 07:33:49 +0000 (07:33 +0000)
committerMartin Braenne <mboehme@google.com>
Thu, 16 Mar 2023 08:15:13 +0000 (08:15 +0000)
commitddbcd985602dcb5fe78fcf2246cf53922db1f3c3
treef9fcec001402c0f7b97b8cee4e64d52543f91443
parent79afa58c2779db21d1ee7d65d32d5250e58e7226
[clang-tidy] Correctly handle evaluation order of designated initializers.

As designated initializers show up only in the syntactic form of the
InitListExpr, we need to make sure we're searching both forms of the
InitListExpr when determining successors in the evaluation order.

This fixes a bug in bugprone-use-after-move where previously we erroneously
concluded that two designated initializers were unsequenced. The newly added
tests fail without the fix.

Differential Revision: https://reviews.llvm.org/D145906
clang-tools-extra/clang-tidy/utils/ExprSequence.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone/use-after-move.cpp