[PATCH] D153716: [ASTMatchers] Add argumentCountAtLeast narrowing matcher

Mike Crowe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 25 08:26:34 PDT 2023


mikecrowe created this revision.
mikecrowe added a reviewer: PiotrZSL.
Herald added a project: All.
mikecrowe requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
mikecrowe added inline comments.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:1671
+      notMatches("void x(int, int = 1) { x(0); }",
+                 traverse(TK_IgnoreUnlessSpelledInSource, Call2PlusArgs)));
+  EXPECT_TRUE(
----------------
I'm not sure if this is the best way to trigger testing of the ignoring default argument path in the implementation of `argumentCountAtLeast`, but it does seem to work. I added explicit `TK_AsIs` to the tests above to make it clear that they are not testing that path.


This will be used by the modernize-use-std-print clang-tidy check and
related checks later.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153716

Files:
  clang/docs/LibASTMatchersReference.html
  clang/include/clang/ASTMatchers/ASTMatchers.h
  clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153716.534309.patch
Type: text/x-patch
Size: 11016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230625/d2512d8d/attachment-0001.bin>


More information about the cfe-commits mailing list