This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Don't use a SmallSetVector of an enum.
ClosedPublic

Authored by jlebar on Oct 15 2016, 3:54 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

jlebar updated this revision to Diff 74780.Oct 15 2016, 3:54 PM
jlebar retitled this revision from to [clang-tidy] Don't use a SmallSetVector of an enum..
jlebar updated this object.
jlebar added a reviewer: timshen.
jlebar added a subscriber: cfe-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: timshen.

Hi, friendly ping? This trivial patch is the only blocker remaining before I can land D25648, which is the first part of my Grand Set Refactoring (see mail to llvm-dev about a week ago).

aaron.ballman accepted this revision.Oct 21 2016, 8:58 AM
aaron.ballman edited edge metadata.

LGTM with two minor nits.

clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
102 ↗(On Diff #74780)

Please don't use auto since the type is not spelled out in the initializer.

103 ↗(On Diff #74780)

Please drop the push_back() onto its own line.

This revision is now accepted and ready to land.Oct 21 2016, 8:58 AM

Thank you very much for the review!

clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
103 ↗(On Diff #74780)

This was actually how clang-tidy formatted the line. My understanding is that we go with that in llvm projects? Unless you're saying I have an outdated clang-tidy, in which case I will investigate that.

bkramer added inline comments.
clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
103 ↗(On Diff #74780)

It's what happens when your clang-format is using Google style. Some versions of clang-format ship with weird defaults, so you have to add -style=LLVM manually.

jlebar added a comment.EditedOct 21 2016, 9:04 AM
This comment has been deleted.
clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
103 ↗(On Diff #74780)

Er, s/clang-tidy/clang-format/

jlebar updated this revision to Diff 75443.Oct 21 2016, 9:22 AM
jlebar marked 5 inline comments as done.
jlebar edited edge metadata.

Adjust formatting, write out type of 'auto'.

clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
103 ↗(On Diff #74780)

Oh, this is happening because clang-tools-extra does not have a .clang-format file in tree. It's relying on us picking up clang's .clang-format file, but if you use the monorepo [0] (or if you have a tool that's smart and stops at git repository boundaries) you won't find it.

Mystery solved. I can check those files in if you want, or not if you want. :)

[0] https://github.com/llvm-project/llvm-project

This revision was automatically updated to reflect the committed changes.

Thank you for the reviews, everyone!