From 6f2c95657b083063039065cc9729d0a428e44140 Mon Sep 17 00:00:00 2001 From: Nathan James Date: Thu, 3 Feb 2022 14:11:30 +0000 Subject: [PATCH] [clang][docs] Regenerate ASTMatchers documentation --- clang/docs/LibASTMatchersReference.html | 85 ++++++++++++++++++++++++++------- 1 file changed, 68 insertions(+), 17 deletions(-) diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 4c3916c..a3f5799 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -2745,6 +2745,18 @@ unaryTransformType() +Matcher<Type>usingTypeMatcher<UsingType>... +
Matches types specified through a using declaration.
+
+Given
+  namespace a { struct S {}; }
+  using a::S;
+  S s;
+
+usingType() matches the type of the variable declaration of s.
+
+ + Matcher<Type>variableArrayTypeMatcher<VariableArrayType>...
Matches C arrays with a specified size that is not an
 integer-constant-expression.
@@ -4201,8 +4213,8 @@ auto Y() -> int {}
 
-Matcher<FunctionDecl>isConsteval -
Matches consteval function declarations and if consteval/if ! consteval
+Matcher<FunctionDecl>isConsteval
+
Matches consteval function declarations and if consteval/if ! consteval
 statements.
 
 Given:
@@ -4489,8 +4501,8 @@ functionProtoType(parameterCountIs(3))
 
-Matcher<IfStmt>isConsteval -
Matches consteval function declarations and if consteval/if ! consteval
+Matcher<IfStmt>isConsteval
+
Matches consteval function declarations and if consteval/if ! consteval
 statements.
 
 Given:
@@ -5633,7 +5645,7 @@ ifStmt(isConstexpr())
 
 Given:
   constinit int foo = 42;
-  constinit const char* bar = "baz";
+  constinit const char* bar = "bar";
   int baz = 42;
   [[clang::require_constant_initialization]] int xyz = 42;
 varDecl(isConstinit())
@@ -7549,19 +7561,24 @@ varDecl(hasTypeLoc(templateSpecializationTypeLoc(hasTemplateArgumentLoc(0,
 
-Matcher<DeclRefExpr>throughUsingDeclMatcher<UsingShadowDecl> InnerMatcher -
Matches a DeclRefExpr that refers to a declaration through a
-specific using shadow declaration.
+Matcher<DeclRefExpr>throughUsingDeclMatcher<UsingShadowDecl> Inner
+
Matches if a node refers to a declaration through a specific
+using shadow declaration.
 
-Given
-  namespace a { void f() {} }
+Examples:
+  namespace a { int f(); }
   using a::f;
-  void g() {
-    f();     // Matches this ..
-    a::f();  // .. but not this.
-  }
+  int x = f();
 declRefExpr(throughUsingDecl(anything()))
-  matches f()
+  matches f
+
+  namespace a { class X{}; }
+  using a::X;
+  X x;
+typeLoc(loc(usingType(throughUsingDecl(anything()))))
+  matches X
+
+Usable as: Matcher<DeclRefExpr>, Matcher<UsingType>
 
@@ -7651,7 +7668,7 @@ declaration of class D. Matcher<DecltypeType>hasUnderlyingTypeMatcher<Type> -
Matches DecltypeType nodes to find out the underlying type.
+
Matches DecltypeType or UsingType nodes to find the underlying type.
 
 Given
   decltype(1) a = 1;
@@ -7659,7 +7676,7 @@ Given
 decltypeType(hasUnderlyingType(isInteger()))
   matches the type of "a"
 
-Usable as: Matcher<DecltypeType>
+Usable as: Matcher<DecltypeType>, Matcher<UsingType>
 
@@ -9658,6 +9675,40 @@ usingDecl(hasAnyUsingShadowDecl(hasTargetDecl(functionDecl()))) matches using X::b but not using X::a
+Matcher<UsingType>hasUnderlyingTypeMatcher<Type> +
Matches DecltypeType or UsingType nodes to find the underlying type.
+
+Given
+  decltype(1) a = 1;
+  decltype(2.0) b = 2.0;
+decltypeType(hasUnderlyingType(isInteger()))
+  matches the type of "a"
+
+Usable as: Matcher<DecltypeType>, Matcher<UsingType>
+
+ + +Matcher<UsingType>throughUsingDeclMatcher<UsingShadowDecl> Inner +
Matches if a node refers to a declaration through a specific
+using shadow declaration.
+
+Examples:
+  namespace a { int f(); }
+  using a::f;
+  int x = f();
+declRefExpr(throughUsingDecl(anything()))
+  matches f
+
+  namespace a { class X{}; }
+  using a::X;
+  X x;
+typeLoc(loc(usingType(throughUsingDecl(anything()))))
+  matches X
+
+Usable as: Matcher<DeclRefExpr>, Matcher<UsingType>
+
+ + Matcher<ValueDecl>hasTypeMatcher<Decl> InnerMatcher
Overloaded to match the declaration of the expression's or value
 declaration's type.
-- 
2.7.4