From: Daniel Jasper Date: Tue, 4 Dec 2012 12:08:08 +0000 (+0000) Subject: Update matcher documentation with script. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e0b89972cae100d60690e78973f53d2dac3c060e;p=clang Update matcher documentation with script. We still need to make the python script understand some of the new matchers, but this should be an improvement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169258 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index ea038e38c8..ec703d3b7b 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -229,180 +229,110 @@ Example matches a -Matcher<Expr>boolLiteralMatcher<CXXBoolLiteralExpr>... -
Matches bool literals.
-
-Example matches true
-  true
-
- - -Matcher<Expr>castExprMatcher<CastExpr>... -
Matches any cast nodes of Clang's AST.
-
-Example: castExpr() matches each of the following:
-  (int) 3;
-  const_cast<Expr *>(SubExpr);
-  char c = 0;
-but does not match
-  int i = (0);
-  int k = 0;
-
- - -Matcher<Expr>characterLiteralMatcher<CharacterLiteral>... -
Matches character literals (also matches wchar_t).
-
-Not matching Hex-encoded chars (e.g. 0x1234, which is a IntegerLiteral),
-though.
-
-Example matches 'a', L'a'
-  char ch = 'a'; wchar_t chw = L'a';
-
- - -Matcher<Expr>constCastExprMatcher<CXXConstCastExpr>... -
Matches a const_cast expression.
-
-Example: Matches const_cast<int*>(&r) in
-  int n = 42;
-  const int &r(n);
-  int* p = const_cast<int*>(&r);
-
- - -Matcher<Expr>dynamicCastExprMatcher<CXXDynamicCastExpr>... -
Matches a dynamic_cast expression.
+Matcher<Stmt>arraySubscriptExprMatcher<ArraySubscriptExpr>...
+
Matches array subscript expressions.
 
-Example:
-  dynamicCastExpr()
-matches
-  dynamic_cast<D*>(&b);
-in
-  struct B { virtual ~B() {} }; struct D : B {};
-  B b;
-  D* p = dynamic_cast<D*>(&b);
+Given
+  int i = a[1];
+arraySubscriptExpr()
+  matches "a[1]"
 
-Matcher<Expr>explicitCastExprMatcher<ExplicitCastExpr>... -
Matches explicit cast expressions.
-
-Matches any cast expression written in user code, whether it be a
-C-style cast, a functional-style cast, or a keyword cast.
-
-Does not match implicit conversions.
-
-Note: the name "explicitCast" is chosen to match Clang's terminology, as
-Clang uses the term "cast" to apply to implicit conversions as well as to
-actual cast expressions.
+Matcher<Stmt>asmStmtMatcher<AsmStmt>...
+
Matches asm statements.
 
-hasDestinationType.
-
-Example: matches all five of the casts in
-  int((int)(reinterpret_cast<int>(static_cast<int>(const_cast<int>(42)))))
-but does not match the implicit conversion in
-  long ell = 42;
+ int i = 100;
+  __asm("mov al, 2");
+asmStmt()
+  matches '__asm("mov al, 2")'
 
-Matcher<Expr>functionalCastExprMatcher<CXXFunctionalCastExpr>... -
Matches functional cast expressions
+Matcher<Stmt>binaryOperatorMatcher<BinaryOperator>...
+
Matches binary operator expressions.
 
-Example: Matches Foo(bar);
-  Foo f = bar;
-  Foo g = (Foo) bar;
-  Foo h = Foo(bar);
+Example matches a || b
+  !(a || b)
 
-Matcher<Expr>implicitCastExprMatcher<ImplicitCastExpr>... -
Matches the implicit cast nodes of Clang's AST.
+Matcher<Stmt>bindTemporaryExprMatcher<CXXBindTemporaryExpr>...
+
Matches nodes where temporaries are created.
 
-This matches many different places, including function call return value
-eliding, as well as any type conversions.
+Example matches FunctionTakesString(GetStringByValue())
+    (matcher = bindTemporaryExpr())
+  FunctionTakesString(GetStringByValue());
+  FunctionTakesStringByPointer(GetStringPointer());
 
-Matcher<Expr>integerLiteralMatcher<IntegerLiteral>... -
Matches integer literals of all sizes encodings.
-
-Not matching character-encoded integers such as L'a'.
+Matcher<Stmt>boolLiteralMatcher<CXXBoolLiteralExpr>...
+
Matches bool literals.
 
-Example matches 1, 1L, 0x1, 1U
+Example matches true
+  true
 
-Matcher<Expr>reinterpretCastExprMatcher<CXXReinterpretCastExpr>... -
Matches a reinterpret_cast expression.
-
-Either the source expression or the destination type can be matched
-using has(), but hasDestinationType() is more specific and can be
-more readable.
+Matcher<Stmt>breakStmtMatcher<BreakStmt>...
+
Matches break statements.
 
-Example matches reinterpret_cast<char*>(&p) in
-  void* p = reinterpret_cast<char*>(&p);
+Given
+  while (true) { break; }
+breakStmt()
+  matches 'break'
 
-Matcher<Expr>staticCastExprMatcher<CXXStaticCastExpr>... -
Matches a C++ static_cast expression.
+Matcher<Stmt>cStyleCastExprMatcher<CStyleCastExpr>...
+
Matches a C-style cast expression.
 
-hasDestinationType
-reinterpretCast
-
-Example:
-  staticCastExpr()
-matches
-  static_cast<long>(8)
-in
-  long eight(static_cast<long>(8));
+Example: Matches (int*) 2.2f in
+  int i = (int) 2.2f;
 
-Matcher<Expr>stringLiteralMatcher<StringLiteral>... -
Matches string literals (also matches wide string literals).
+Matcher<Stmt>callExprMatcher<CallExpr>...
+
Matches call expressions.
 
-Example matches "abcd", L"abcd"
-  char *s = "abcd"; wchar_t *ws = L"abcd"
+Example matches x.y() and y()
+  X x;
+  x.y();
+  y();
 
-Matcher<Stmt>arraySubscriptExprMatcher<ArraySubscriptExpr>... -
Matches array subscript expressions.
+Matcher<Stmt>castExprMatcher<CastExpr>...
+
Matches any cast nodes of Clang's AST.
 
-Given
-  int i = a[1];
-arraySubscriptExpr()
-  matches "a[1]"
+Example: castExpr() matches each of the following:
+  (int) 3;
+  const_cast<Expr *>(SubExpr);
+  char c = 0;
+but does not match
+  int i = (0);
+  int k = 0;
 
-Matcher<Stmt>binaryOperatorMatcher<BinaryOperator>... -
Matches binary operator expressions.
+Matcher<Stmt>catchStmtMatcher<CXXCatchStmt>...
+
Matches catch statements.
 
-Example matches a || b
-  !(a || b)
+  try {} catch(int i) {}
+catchStmt()
+  matches 'catch(int i)'
 
-Matcher<Stmt>bindTemporaryExprMatcher<CXXBindTemporaryExpr>... -
Matches nodes where temporaries are created.
-
-Example matches FunctionTakesString(GetStringByValue())
-    (matcher = bindTemporaryExpr())
-  FunctionTakesString(GetStringByValue());
-  FunctionTakesStringByPointer(GetStringPointer());
-
- +Matcher<Stmt>characterLiteralMatcher<CharacterLiteral>... +
Matches character literals (also matches wchar_t).
 
-Matcher<Stmt>callExprMatcher<CallExpr>...
-
Matches call expressions.
+Not matching Hex-encoded chars (e.g. 0x1234, which is a IntegerLiteral),
+though.
 
-Example matches x.y() and y()
-  X x;
-  x.y();
-  y();
+Example matches 'a', L'a'
+  char ch = 'a'; wchar_t chw = L'a';
 
@@ -422,6 +352,16 @@ Example matches a ? b : c
+Matcher<Stmt>constCastExprMatcher<CXXConstCastExpr>... +
Matches a const_cast expression.
+
+Example: Matches const_cast<int*>(&r) in
+  int n = 42;
+  const int &r(n);
+  int* p = const_cast<int*>(&r);
+
+ + Matcher<Stmt>constructExprMatcher<CXXConstructExpr>...
Matches constructor call expressions (including implicit ones).
 
@@ -434,6 +374,16 @@ Example matches string(ptr, n) and ptr within arguments of f
 
+Matcher<Stmt>continueStmtMatcher<ContinueStmt>... +
Matches continue statements.
+
+Given
+  while (true) { continue; }
+continueStmt()
+  matches 'continue'
+
+ + Matcher<Stmt>declRefExprMatcher<DeclRefExpr>...
Matches expressions that refer to declarations.
 
@@ -484,6 +434,41 @@ doStmt()
 
+Matcher<Stmt>dynamicCastExprMatcher<CXXDynamicCastExpr>... +
Matches a dynamic_cast expression.
+
+Example:
+  dynamicCastExpr()
+matches
+  dynamic_cast<D*>(&b);
+in
+  struct B { virtual ~B() {} }; struct D : B {};
+  B b;
+  D* p = dynamic_cast<D*>(&b);
+
+ + +Matcher<Stmt>explicitCastExprMatcher<ExplicitCastExpr>... +
Matches explicit cast expressions.
+
+Matches any cast expression written in user code, whether it be a
+C-style cast, a functional-style cast, or a keyword cast.
+
+Does not match implicit conversions.
+
+Note: the name "explicitCast" is chosen to match Clang's terminology, as
+Clang uses the term "cast" to apply to implicit conversions as well as to
+actual cast expressions.
+
+hasDestinationType.
+
+Example: matches all five of the casts in
+  int((int)(reinterpret_cast<int>(static_cast<int>(const_cast<int>(42)))))
+but does not match the implicit conversion in
+  long ell = 42;
+
+ + Matcher<Stmt>exprMatcher<Expr>...
Matches expressions.
 
@@ -492,11 +477,42 @@ Example matches x()
 
+Matcher<Stmt>forRangeStmtMatcher<CXXForRangeStmt>... +
Matches range-based for statements.
+
+forRangeStmt() matches 'for (auto a : i)'
+  int i[] =  {1, 2, 3}; for (auto a : i);
+  for(int j = 0; j < 5; ++j);
+
+ + Matcher<Stmt>forStmtMatcher<ForStmt>...
Matches for statements.
 
 Example matches 'for (;;) {}'
   for (;;) {}
+  int i[] =  {1, 2, 3}; for (auto a : i);
+
+ + +Matcher<Stmt>functionalCastExprMatcher<CXXFunctionalCastExpr>... +
Matches functional cast expressions
+
+Example: Matches Foo(bar);
+  Foo f = bar;
+  Foo g = (Foo) bar;
+  Foo h = Foo(bar);
+
+ + +Matcher<Stmt>gotoStmtMatcher<GotoStmt>... +
Matches goto statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+gotoStmt()
+  matches 'goto FOO'
 
@@ -508,6 +524,14 @@ Example matches 'if (x) {}'
+Matcher<Stmt>implicitCastExprMatcher<ImplicitCastExpr>... +
Matches the implicit cast nodes of Clang's AST.
+
+This matches many different places, including function call return value
+eliding, as well as any type conversions.
+
+ + Matcher<Stmt>initListExprMatcher<InitListExpr>...
Matches init list expressions.
 
@@ -520,6 +544,34 @@ initList()
 
+Matcher<Stmt>integerLiteralMatcher<IntegerLiteral>... +
Matches integer literals of all sizes encodings.
+
+Not matching character-encoded integers such as L'a'.
+
+Example matches 1, 1L, 0x1, 1U
+
+ + +Matcher<Stmt>labelStmtMatcher<LabelStmt>... +
Matches label statements.
+
+Given
+  goto FOO;
+  FOO: bar();
+labelStmt()
+  matches 'FOO:'
+
+ + +Matcher<Stmt>lambdaExprMatcher<LambdaExpr>... +
Matches lambda expressions.
+
+Example matches [&](){return 5;}
+  [&](){return 5;}
+
+ + Matcher<Stmt>materializeTemporaryExprMatcher<MaterializeTemporaryExpr>...
Matches nodes where temporaries are materialized.
 
@@ -568,6 +620,20 @@ newExpr()
 
+Matcher<Stmt>nullPtrLiteralExprMatcher<CXXNullPtrLiteralExpr>... +
Matches nullptr literal.
+
+ + +Matcher<Stmt>nullStmtMatcher<NullStmt>... +
Matches null statements.
+
+  foo();;
+nullStmt()
+  matches the second ';'
+
+ + Matcher<Stmt>operatorCallExprMatcher<CXXOperatorCallExpr>...
Matches overloaded operator calls.
 
@@ -584,6 +650,43 @@ Example matches both operator<<((o << b), c) and operator<<(o,
 
+Matcher<Stmt>reinterpretCastExprMatcher<CXXReinterpretCastExpr>... +
Matches a reinterpret_cast expression.
+
+Either the source expression or the destination type can be matched
+using has(), but hasDestinationType() is more specific and can be
+more readable.
+
+Example matches reinterpret_cast<char*>(&p) in
+  void* p = reinterpret_cast<char*>(&p);
+
+ + +Matcher<Stmt>returnStmtMatcher<ReturnStmt>... +
Matches return statements.
+
+Given
+  return 1;
+returnStmt()
+  matches 'return 1'
+
+ + +Matcher<Stmt>staticCastExprMatcher<CXXStaticCastExpr>... +
Matches a C++ static_cast expression.
+
+hasDestinationType
+reinterpretCast
+
+Example:
+  staticCastExpr()
+matches
+  static_cast<long>(8)
+in
+  long eight(static_cast<long>(8));
+
+ + Matcher<Stmt>stmtMatcher<Stmt>...
Matches statements.
 
@@ -594,6 +697,14 @@ stmt()
 
+Matcher<Stmt>stringLiteralMatcher<StringLiteral>... +
Matches string literals (also matches wide string literals).
+
+Example matches "abcd", L"abcd"
+  char *s = "abcd"; wchar_t *ws = L"abcd"
+
+ + Matcher<Stmt>switchCaseMatcher<SwitchCase>...
Matches case and default statements inside switch statements.
 
@@ -604,6 +715,46 @@ switchCase()
 
+Matcher<Stmt>switchStmtMatcher<SwitchStmt>... +
Matches switch statements.
+
+Given
+  switch(a) { case 42: break; default: break; }
+switchStmt()
+  matches 'switch(a)'.
+
+ + +Matcher<Stmt>thisExprMatcher<CXXThisExpr>... +
Matches implicit and explicit this expressions.
+
+Example matches the implicit this expression in "return i".
+    (matcher = thisExpr())
+struct foo {
+  int i;
+  int f() { return i; }
+};
+
+ + +Matcher<Stmt>throwExprMatcher<CXXThrowExpr>... +
Matches throw expressions.
+
+  try { throw 5; } catch(int i) {}
+throwExpr()
+  matches 'throw 5'
+
+ + +Matcher<Stmt>tryStmtMatcher<CXXTryStmt>... +
Matches try statements.
+
+  try {} catch(int i) {}
+tryStmt()
+  matches 'try {}'
+
+ + Matcher<Stmt>unaryExprOrTypeTraitExprMatcher<UnaryExprOrTypeTraitExpr>...
Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
 
@@ -623,6 +774,13 @@ Example matches !a
 
+Matcher<Stmt>userDefinedLiteralMatcher<UserDefinedLiteral>... +
Matches user defined literal operator call.
+
+Example match: "foo"_suffix
+
+ + Matcher<Stmt>whileStmtMatcher<WhileStmt>...
Matches while statements.
 
@@ -632,6 +790,16 @@ whileStmt()
   matches 'while (true) {}'.
 
+ +Matcher<TypeLoc>typeLocMatcher<TypeLoc>... +
Matches TypeLocs in the clang AST.
+
+ + +Matcher<Type>typeMatcher<Type>... +
Matches Types in the clang AST.
+
+ @@ -745,11 +913,6 @@ Example matches a << b
-Matcher<CXXRecordDecl>isAStringRef BaseName -
Overloaded method as shortcut for isA(hasName(...)).
-
- - Matcher<CXXRecordDecl>isDerivedFromStringRef BaseName
Overloaded method as shortcut for isDerivedFrom(hasName(...)).
 
@@ -769,6 +932,12 @@ Usable as: Matcher<CXXRecordDecl>isSameOrDerivedFromStringRef BaseName +
Overloaded method as shortcut for
+isSameOrDerivedFrom(hasName(...)).
+
+ + Matcher<CXXRecordDecl>isTemplateInstantiation
Matches template instantiations of function, class, or static
 member variable template instantiations.
@@ -823,6 +992,18 @@ compoundStmt(statementCountIs(0)))
 
+Matcher<ConstantArrayType>hasSizeunsigned N +
Matches ConstantArrayType nodes that have the specified size.
+
+Given
+  int a[42];
+  int b[2 * 21];
+  int c[41], d[43];
+constantArrayType(hasSize(42))
+  matches "int a[42]" and "int b[2 * 21]"
+
+ + Matcher<DeclStmt>declCountIsunsigned N
Matches declaration statements that contain a specific number of
 declarations.
@@ -909,6 +1090,17 @@ Usable as: Matcher<FunctionDecl>parameterCountIsunsigned N
+
Matches FunctionDecls that have a specific parameter count.
+
+Given
+  void f(int i) {}
+  void g(int i, int j) {}
+functionDecl(parameterCountIs(2))
+  matches g(int i, int j) {}
+
+ + Matcher<IntegerLiteral>equalsValueT Value
Matches literals that are equal to the given value.
 
@@ -1174,7 +1366,7 @@ matcher.
 Given
 void f() { if (true) { int x = 42; } }
 void g() { for (;;) { int x = 43; } }
-expr(integerLiteral(hasAncsestor(ifStmt()))) matches 42, but not 43.
+expr(integerLiteral(hasAncestor(ifStmt()))) matches 42, but not 43.
 
 Usable as: Any Matcher
 
@@ -1196,6 +1388,18 @@ Usable as: Any Matcher
+Matcher<*>hasParentMatcher<ParentT> ParentMatcher +
Matches AST nodes that have a parent that matches the provided
+matcher.
+
+Given
+void f() { for (;;) { int x = 42; if (true) { int x = 43; } } }
+compoundStmt(hasParent(ifStmt())) matches "{ int x = 43; }".
+
+Usable as: Any Matcher
+
+ + Matcher<ArraySubscriptExpr>hasBaseMatcher<Expr> InnerMatcher
Matches the base expression of an array subscript expression.
 
@@ -1241,11 +1445,12 @@ Example matches b (matcher = binaryOperator(hasRHS()))
 
-Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
-Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>
+Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
+  Matcher<MemberExpr>
 
@@ -1331,12 +1536,6 @@ Example matches A() in the last line
-Matcher<CXXRecordDecl>isAMatcher<NamedDecl> Base -
Similar to isDerivedFrom(), but also matches classes that directly
-match Base.
-
- - Matcher<CXXRecordDecl>isDerivedFromMatcher<NamedDecl> Base
Matches C++ classes that are directly or indirectly derived from
 a class matching Base.
@@ -1358,6 +1557,12 @@ In the following example, Bar matches isDerivedFrom(hasName("X")):
 
+Matcher<CXXRecordDecl>isSameOrDerivedFromMatcher<NamedDecl> Base +
Similar to isDerivedFrom(), but also matches classes that directly
+match Base.
+
+ + Matcher<CallExpr>calleeMatcher<Decl> InnerMatcher
Matches if the call expression's callee's declaration matches the
 given matcher.
@@ -1391,11 +1596,12 @@ Example matches y in x(y)
 
-Matcher<CallExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<CallExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a type if the declaration of the type matches the given
 matcher.
 
-Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>
+Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
+  Matcher<MemberExpr>
 
@@ -1753,6 +1959,15 @@ FIXME: Unit test this matcher
+Matcher<MemberExpr>hasDeclarationMatcher<Decl> InnerMatcher +
Matches a type if the declaration of the type matches the given
+matcher.
+
+Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
+  Matcher<MemberExpr>
+
+ + Matcher<MemberExpr>hasObjectExpressionMatcher<Expr> InnerMatcher
Matches a member expression where the object expression is
 matched by a given matcher.
@@ -1781,11 +1996,71 @@ memberExpr(member(hasName("first")))
 
-Matcher<QualType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a type if the declaration of the type matches the given
+Matcher<NestedNameSpecifierLoc>hasPrefixMatcher<NestedNameSpecifierLoc>  InnerMatcher
+
Matches on the prefix of a NestedNameSpecifierLoc.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifierLoc(hasPrefix(loc(specifiesType(asString("struct A")))))
+  matches "A::"
+
+ + +Matcher<NestedNameSpecifierLoc>specifiesTypeLocMatcher<TypeLoc> InnerMatcher +
Matches nested name specifier locs that specify a type matching the
+given TypeLoc.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifierLoc(specifiesTypeLoc(loc(type(
+  hasDeclaration(recordDecl(hasName("A")))))))
+  matches "A::"
+
+ + +Matcher<NestedNameSpecifier>hasPrefixMatcher<NestedNameSpecifier> InnerMatcher +
Matches on the prefix of a NestedNameSpecifier.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifier(hasPrefix(specifiesType(asString("struct A")))) and
+  matches "A::"
+
+ + +Matcher<NestedNameSpecifier>specifiesNamespaceMatcher<NamespaceDecl> InnerMatcher +
Matches nested name specifiers that specify a namespace matching the
+given namespace matcher.
+
+Given
+  namespace ns { struct A {}; }
+  ns::A a;
+nestedNameSpecifier(specifiesNamespace(hasName("ns")))
+  matches "ns::"
+
+ + +Matcher<NestedNameSpecifier>specifiesTypeMatcher<QualType> InnerMatcher +
Matches nested name specifiers that specify a type matching the
+given QualType matcher without qualifiers.
+
+Given
+  struct A { struct B { struct C {}; }; };
+  A::B::C c;
+nestedNameSpecifier(specifiesType(hasDeclaration(recordDecl(hasName("A")))))
+  matches "A::"
+
+ + +Matcher<QualType>hasDeclarationMatcher<Decl> InnerMatcher +
Matches a type if the declaration of the type matches the given
 matcher.
 
-Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>
+Usable as: Matcher<QualType>, Matcher<CallExpr>, Matcher<CXXConstructExpr>,
+  Matcher<MemberExpr>
 
@@ -1838,6 +2113,12 @@ classTemplateSpecializationDecl(hasAnyTemplateArgument(
+Matcher<TypedefType>hasDeclMatcher<TypedefNameDecl> InnerMatcher +
Matches TypedefTypes referring to a specific
+TypedefNameDecl.
+
+ + Matcher<UnaryExprOrTypeTraitExpr>hasArgumentOfTypeMatcher<QualType> InnerMatcher
Matches unary expressions that have a specific type of argument.
 
@@ -1851,7 +2132,7 @@ unaryExprOrTypeTraitExpr(hasArgumentOfType(asString("int"))
 Matcher<UnaryOperator>hasUnaryOperandMatcher<Expr> InnerMatcher
 
Matches if the operand of a unary operator matches.
 
-Example matches true (matcher = hasOperand(boolLiteral(equals(true))))
+Example matches true (matcher = hasUnaryOperand(boolLiteral(equals(true))))
   !true
 
@@ -1907,6 +2188,20 @@ Example matches x (matcher = varDecl(hasInitializer(callExpr())))
+Matcher<VariableArrayType>hasSizeExprMatcher<Expr> InnerMatcher +
Matches VariableArrayType nodes that have a specific size
+expression.
+
+Given
+  void f(int b) {
+    int a[b];
+  }
+variableArrayType(hasSizeExpr(ignoringImpCasts(declRefExpr(to(
+  varDecl(hasName("b")))))))
+  matches "int a[b]"
+
+ + Matcher<WhileStmt>hasBodyMatcher<Stmt> InnerMatcher
Matches a 'for', 'while', or 'do while' statement that has
 a given body.