[PATCH] D28034: [ASTMatchers] Add hasInClassInitializer traversal matcher for FieldDecl.

Malcolm Parsons via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 21 15:03:24 PST 2016


malcolm.parsons created this revision.
malcolm.parsons added reviewers: sbenza, bkramer, klimek.
malcolm.parsons added a subscriber: cfe-commits.

I needed to know whether a FieldDecl had an in-class
initializer for https://reviews.llvm.org/D26453. I used a narrowing matcher there, but a
traversal matcher might be generally useful.

VarDecl has a hasInitializer traversal matcher.
ForStmt has a withLoopInit traversal matcher.
CXXCtorInitializer has a withInitializer traversal matcher.
EnumConstantDecl doesn't have a traversal matcher for its initializer.
IfStmt doesn't have a traversal matcher for its initializer.


https://reviews.llvm.org/D28034

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28034.82278.patch
Type: text/x-patch
Size: 4914 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161221/12061441/attachment.bin>


More information about the cfe-commits mailing list