[PATCH] D146922: [clang-tidy] Fix false positve for defaulted move constructor in performance-noexcept-move-constructor

André Schackier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 26 11:08:08 PDT 2023


AMS21 created this revision.
AMS21 added a reviewer: njames93.
Herald added subscribers: PiotrZSL, carlosgalvezp, xazax.hun.
Herald added a project: All.
AMS21 requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Previously a struct like this:

template <typename>
struct A { A(A&&) = default; };

Would trigger a false positive, since it didn't realize that a defaulted
move constructor is automatically considered being noexcept.
Now we only give a warning if the defaulted move constrcutor has a
noexcept expression which evaluated to false but is not simply
`noexcept(false)`.

This fixes llvm#56026


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146922

Files:
  clang-tools-extra/clang-tidy/performance/NoexceptMoveConstructorCheck.cpp
  clang-tools-extra/test/clang-tidy/checkers/performance/noexcept-move-constructor-fix.cpp
  clang-tools-extra/test/clang-tidy/checkers/performance/noexcept-move-constructor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146922.508434.patch
Type: text/x-patch
Size: 4735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230326/2bc13c80/attachment.bin>


More information about the cfe-commits mailing list