This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add FixItHint for performance-noexcept-move-constructor
ClosedPublic

Authored by zinovy.nis on Jul 22 2019, 10:53 AM.

Diff Detail

Event Timeline

zinovy.nis created this revision.Jul 22 2019, 10:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 22 2019, 10:53 AM
aaron.ballman added inline comments.Jul 22 2019, 1:33 PM
clang-tidy/performance/NoexceptMoveConstructorCheck.cpp
57

Does getParamDecl()->getEndLoc() not give the correct answer?

test/clang-tidy/performance-noexcept-move-constructor-fix.cpp
8

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.

zinovy.nis marked an inline comment as done.Jul 23 2019, 11:26 PM
zinovy.nis added inline comments.
clang-tidy/performance/NoexceptMoveConstructorCheck.cpp
57

Unfortunately not. In that case

C_1(C_1&& a) :C_1(5) {} turns into C_1(C_1&& a noexcept) :C_1(5) {}. instead of C_1(C_1&& a) noexcept :C_1(5) {}

zinovy.nis marked an inline comment as done.Jul 23 2019, 11:26 PM
  • Fixed tests.
zinovy.nis marked an inline comment as done.
This revision is now accepted and ready to land.Jul 24 2019, 4:22 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2019, 6:32 AM