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

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 00:33:56 PDT 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/ArgumentCommentCheck.cpp:68
+               // them does more harm than good.
+               unless(hasDeclaration((isFromStdNamespace()))))
+          .bind("expr"),
----------------
gribozavr2 wrote:
> gribozavr2 wrote:
> > Please use the isInStdNamespace() matcher instead.
> I think there are redundant parentheses around `isFromStdNamespace()`.
`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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79494/new/

https://reviews.llvm.org/D79494





More information about the cfe-commits mailing list