[PATCH] D80603: add isAtPosition narrowing matcher for parmVarDecl

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 23:22:47 PDT 2020


gribozavr2 added a comment.

Please run clang/docs/tools/dump_ast_matchers.py to update the docs.



================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:7022
+      .matches(Node, Finder, Builder);
+}
+
----------------
Could you move it closer to other parameter-related matchers, maybe near the definition of `forEachArgumentWithParam`?


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:2650
+  EXPECT_TRUE(matches("void x(int a, int b) {}", parmVarDecl(isAtPosition(1))));
+  EXPECT_TRUE(notMatches("void x(int val) {}", parmVarDecl(isAtPosition(1))));
+}
----------------
Could you change some tests to have a function declaration instead of definition?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80603





More information about the cfe-commits mailing list