[clang-tidy] Ignore other members in a union if any member of it is initialized in...
authorSockke <liuke.gehry@bytedance.com>
Thu, 25 Aug 2022 10:23:57 +0000 (18:23 +0800)
committerSockke <liuke.gehry@bytedance.com>
Thu, 25 Aug 2022 10:47:38 +0000 (18:47 +0800)
commit2d8e91a5d3597461b5ae2a40d9362abde67b5e1f
treefe7307518ad2338e7550dc5bc0f2ffa69743a615
parentbaeb17cdfa4bba8985ebb9809edf7eb82c636bc4
[clang-tidy] Ignore other members in a union if any member of it is initialized in cppcoreguidelines-pro-type-member-init

If a union member is initialized, the other members of the union are still suggested to be initialized in this check.  This patch fixes this behavior.
Reference issue: https://github.com/llvm/llvm-project/issues/54748

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D127293
clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/pro-type-member-init.cpp