[PATCH] D97246: [ASTMatchers] Fix matching failure in IgnoreUnlessSpelledInSource mode

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 22 19:10:40 PST 2021


njames93 created this revision.
njames93 added reviewers: klimek, steveire, aaron.ballman.
njames93 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

For the hasAnyCtorInitializer matcher, the matcher finds the first innermatch that is successful.
Then it checks if it should be ignored, and if so, the whole match fails.
This opens up an issue when an implicit initializer matchers the inner matcher but is disregarded for being implicit, preventing an explicit initializer matching.

This also happens with the hasMethod matcher, although I can't get a test to fail using that.
Presumably because implicit methods are generated after all explicit methods.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97246

Files:
  clang/include/clang/ASTMatchers/ASTMatchers.h
  clang/include/clang/ASTMatchers/ASTMatchersInternal.h
  clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97246.325644.patch
Type: text/x-patch
Size: 4011 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210223/e1cd9d47/attachment.bin>


More information about the cfe-commits mailing list