Page MenuHomePhabricator

[clang-tidy] Fix readability-redundant-smartptr-get for MSVC STL
ClosedPublic

Authored by fgross on Apr 26 2019, 12:32 PM.

Details

Summary

The MSVC STL defines smart pointer operator* and operator-> as method templates. The existing duck typing implementation doesn't catch this implementation. To keep the duck typing simple, I added the already existing list of known standard to the matchers in registerMatchersForGetArrowStart.

Diff Detail

Event Timeline

fgross created this revision.Apr 26 2019, 12:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 26 2019, 12:32 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
lebedev.ri retitled this revision from Fix readability-redundant-smartptr-get for MSVC STL to [clang-tidy] Fix readability-redundant-smartptr-get for MSVC STL.Apr 26 2019, 12:40 PM
lebedev.ri added inline comments.
clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
60 ↗(On Diff #196898)

not clang-formatted

fgross updated this revision to Diff 196911.Apr 26 2019, 12:57 PM

Fixed format

fgross marked an inline comment as done.Apr 26 2019, 12:57 PM
Eugene.Zelenko added inline comments.
clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-msvc.cpp
96 ↗(On Diff #196911)

Please add new line.

Eugene.Zelenko set the repository for this revision to rG LLVM Github Monorepo.
Eugene.Zelenko added a project: Restricted Project.
Eugene.Zelenko added inline comments.Apr 26 2019, 4:57 PM
clang-tools-extra/test/clang-tidy/readability-redundant-smartptr-get-msvc.cpp
37 ↗(On Diff #196911)

Unnecessary empty line.

fgross updated this revision to Diff 196960.Apr 27 2019, 3:16 AM

Fixed test file format

fgross marked 2 inline comments as done.Apr 27 2019, 3:16 AM
aaron.ballman accepted this revision.May 1 2019, 3:53 AM

LGTM aside from a commenting nit.

clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
46 ↗(On Diff #196960)

Missing a full stop at the end of the comment.

This revision is now accepted and ready to land.May 1 2019, 3:53 AM
This revision was automatically updated to reflect the committed changes.