[PATCH] D132713: [clang-tidy] Skip union-like classes in use-equals-default

Alexander Shaposhnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 25 17:38:07 PDT 2022


alexander-shaposhnikov created this revision.
alexander-shaposhnikov added reviewers: gribozavr2, njames93.
alexander-shaposhnikov created this object with visibility "All Users".
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a project: All.
alexander-shaposhnikov requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Skip unions/union-like classes since constructors with empty bodies behave
differently in comparison with regular structs/classes
and clang-tidy's fix might break the code in some cases: https://godbolt.org/z/86qd4z55e
This is a follow-up to D132290 <https://reviews.llvm.org/D132290>.
With this patch clang-tidy is able to refactor LLVM/Clang/LLD/LLDB without build breakages.

Test plan: ninja check-clang-tools


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132713

Files:
  clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default-copy.cpp
  clang-tools-extra/test/clang-tidy/checkers/modernize/use-equals-default.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132713.455770.patch
Type: text/x-patch
Size: 3902 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220826/fb92dc58/attachment.bin>


More information about the llvm-commits mailing list