This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Exclude function calls in std namespace for bugprone-argument-comment.
ClosedPublic

Authored by hokein on May 6 2020, 8:21 AM.

Diff Detail

Event Timeline

hokein created this revision.May 6 2020, 8:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2020, 8:21 AM
Herald added a subscriber: xazax.hun. · View Herald Transcript
gribozavr2 added inline comments.May 6 2020, 8:48 AM
clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
67

"Ignore APIs from the standard library, since their names are not specified by the standard, and standard library implementations in practice have to use reserved names to avoid conflicts with same-named macros."

68

Please use the isInStdNamespace() matcher instead.

68

I think there are redundant parentheses around isFromStdNamespace().

gribozavr2 accepted this revision.May 6 2020, 8:48 AM
This revision is now accepted and ready to land.May 6 2020, 8:48 AM
hokein updated this revision to Diff 262556.May 6 2020, 11:51 PM
hokein marked 3 inline comments as done.

address comment.

hokein added inline comments.May 7 2020, 12:00 AM
clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp
68

isInStdNamespace is not a same thing -- it just checks the direct DeclContext is a std namespace, e.g. std::vector::assign, the declcontext of the assign is CXXRecordDecl (vector), isInStdNamespace will return false, but we want true.

This revision was automatically updated to reflect the committed changes.