[PATCH] D89194: [clang-tidy] Fix crash in readability-function-cognitive-complexity on weak refs

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 11 08:16:35 PDT 2020


JonasToth added a comment.

The context thingie was not that important here, but still thanks :)



================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:4658
+/// functionDecl(isWeak())
+///   matches the weak declaration foo, but not bar.
+AST_MATCHER(FunctionDecl, isWeak) { return Node.isWeak(); }
----------------
zinovy.nis wrote:
> JonasToth wrote:
> > Short oversight. Please hightlight the code and matcher to make a differentation in the docs.
> Sorry, I did not fully get what you mean as I just cloned isDefaulted section.
Its not consistent in the docs, but e.g.
`typedefNameDecl() matches "typedef int X" and "using Y = int"` is just more readable in the slightly formatted docs.

my preference would be `"functionDecl(isWeak()) matches the weak declaration "foo", but not "bar".`
(If you do the chance don't forget to recreate the HTML)


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

https://reviews.llvm.org/D89194



More information about the cfe-commits mailing list