From be40902a7dbac3f7a77cbf160fc76b2d71bb2106 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Mon, 6 Jun 2016 18:52:17 +0000 Subject: Adding an AST matcher to ignore parenthesis in *types* (rather than expressions). This is required for traversing certain types (like function pointer types). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@271927 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibASTMatchersReference.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs/LibASTMatchersReference.html') diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 433ba7843f..b944fc6b7e 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -3521,6 +3521,10 @@ Example matches X, Y ChildT must be an AST base type. Usable as: Any Matcher +Note that has is direct matcher, so it also matches things like implicit +casts and paren casts. If you are matching with expr then you should +probably consider using ignoringParenImpCasts like: +has(ignoringParenImpCasts(expr())). @@ -4897,6 +4901,17 @@ Usable as: Matcher<QualType>ignoringParensMatcher<QualType> InnerMatcher +
Matches types that match InnerMatcher after any parens are stripped.
+
+Given
+  void (*fp)(void);
+The matcher
+  varDecl(hasType(pointerType(pointee(ignoringParens(functionType())))))
+would match the declaration for fp.
+
+ + Matcher<QualType>pointsToMatcher<Decl> InnerMatcher
Overloaded to match the pointee type's declaration.
 
-- cgit v1.2.3