[PATCH] D65104: [clang-tidy] Add FixItHint for performance-noexcept-move-constructor
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 22 13:35:05 PDT 2019
aaron.ballman added inline comments.
================
Comment at: clang-tidy/performance/NoexceptMoveConstructorCheck.cpp:57
+ assert(Decl->getNumParams() > 0);
+ SourceLocation NoexceptLoc = Decl->getParamDecl(Decl->getNumParams() - 1)
+ ->getSourceRange()
----------------
Does `getParamDecl()->getEndLoc()` not give the correct answer?
================
Comment at: test/clang-tidy/performance-noexcept-move-constructor-fix.cpp:7
+ C_1(C_1&& a) :C_1(5) {}
+ // CHECK-FIXES:{{.*}}noexcept{{.*}}
+ C_1& operator=(C_1&&) { return *this; }
----------------
This style of test is a bit loose as it will pass even if the fix-it replaces the entire constructor with the `noexcept` token.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D65104/new/
https://reviews.llvm.org/D65104
More information about the cfe-commits
mailing list