This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy]: Add cert-oop54-cpp alias for bugprone-unhandled-self-assignment
ClosedPublic

Authored by ztamas on May 21 2019, 6:00 AM.

Details

Summary

Added WarnOnlyIfThisHasSuspiciousField option to allow
to catch any copy assignment operator independently from
the container class's fields.
Added the cert alias using this option.

Diff Detail

Event Timeline

ztamas created this revision.May 21 2019, 6:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2019, 6:00 AM
aaron.ballman accepted this revision.May 21 2019, 7:47 AM

LGTM aside from some nits, thank you for this!

clang-tools-extra/clang-tidy/bugprone/UnhandledSelfAssignmentCheck.cpp
89–91 ↗(On Diff #200479)

Nothing to be changed here, but it sure would be nice to have a clang-tidy-specific matcher to be used for option handling so we could do this modification using something like unless(!WarnOnlyIfThisHasSuspiciousField).

clang-tools-extra/docs/clang-tidy/checks/bugprone-unhandled-self-assignment.rst
6 ↗(On Diff #200479)

cert alias -> CERT alias, the

7 ↗(On Diff #200479)

Add backticks around the option name.

124 ↗(On Diff #200479)

field -> fields

This revision is now accepted and ready to land.May 21 2019, 7:47 AM

Please mention alias (in aliases list) in Release Notes.

ztamas updated this revision to Diff 200714.May 22 2019, 5:49 AM

Fixed docs.

ztamas updated this revision to Diff 200775.May 22 2019, 9:16 AM

Link burprone module to cert module

This revision was automatically updated to reflect the committed changes.