diff options
Diffstat (limited to 'clang/docs/LibASTMatchersReference.html')
-rw-r--r-- | clang/docs/LibASTMatchersReference.html | 741 |
1 files changed, 405 insertions, 336 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 80f22fa6d17..47666a13867 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -100,8 +100,8 @@ recordDecl(decl().bind("id"), hasName("::MyClass")) <tr style="text-align:left"><th>Return type</th><th>Name</th><th>Parameters</th></tr>
<!-- START_DECL_MATCHERS -->
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('ctorInitializer0')"><a name="ctorInitializer0Anchor">ctorInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="ctorInitializer0"><pre>Matches constructor initializers.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('cxxCtorInitializer0')"><a name="cxxCtorInitializer0Anchor">cxxCtorInitializer</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxCtorInitializer0"><pre>Matches constructor initializers.
Examples matches i(42).
class C {
@@ -144,8 +144,8 @@ classTemplateSpecializationDecl() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('constructorDecl0')"><a name="constructorDecl0Anchor">constructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="constructorDecl0"><pre>Matches C++ constructor declarations.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxConstructorDecl0')"><a name="cxxConstructorDecl0Anchor">cxxConstructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstructorDecl0"><pre>Matches C++ constructor declarations.
Example matches Foo::Foo() and Foo::Foo(int)
class Foo {
@@ -157,14 +157,42 @@ Example matches Foo::Foo() and Foo::Foo(int) </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('conversionDecl0')"><a name="conversionDecl0Anchor">conversionDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html">CXXConversionDecl</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="conversionDecl0"><pre>Matches conversion operator declarations.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxConversionDecl0')"><a name="cxxConversionDecl0Anchor">cxxConversionDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html">CXXConversionDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConversionDecl0"><pre>Matches conversion operator declarations.
Example matches the operator.
class X { operator int() const; };
</pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxDestructorDecl0')"><a name="cxxDestructorDecl0Anchor">cxxDestructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDestructorDecl0"><pre>Matches explicit C++ destructor declarations.
+
+Example matches Foo::~Foo()
+ class Foo {
+ public:
+ virtual ~Foo();
+ };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxMethodDecl0')"><a name="cxxMethodDecl0Anchor">cxxMethodDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxMethodDecl0"><pre>Matches method declarations.
+
+Example matches y
+ class X { void y(); };
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('cxxRecordDecl0')"><a name="cxxRecordDecl0Anchor">cxxRecordDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxRecordDecl0"><pre>Matches C++ class declarations.
+
+Example matches X, Z
+ class X;
+ template<class T> class Z {};
+</pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('decl0')"><a name="decl0Anchor">decl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="decl0"><pre>Matches declarations.
@@ -187,17 +215,6 @@ declaratorDecl() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('destructorDecl0')"><a name="destructorDecl0Anchor">destructorDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDestructorDecl.html">CXXDestructorDecl</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="destructorDecl0"><pre>Matches explicit C++ destructor declarations.
-
-Example matches Foo::~Foo()
- class Foo {
- public:
- virtual ~Foo();
- };
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('enumConstantDecl0')"><a name="enumConstantDecl0Anchor">enumConstantDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1EnumConstantDecl.html">EnumConstantDecl</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="enumConstantDecl0"><pre>Matches enum constants.
@@ -264,14 +281,6 @@ linkageSpecDecl() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('methodDecl0')"><a name="methodDecl0Anchor">methodDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMethodDecl.html">CXXMethodDecl</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="methodDecl0"><pre>Matches method declarations.
-
-Example matches y
- class X { void y(); };
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('namedDecl0')"><a name="namedDecl0Anchor">namedDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NamedDecl.html">NamedDecl</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="namedDecl0"><pre>Matches a declaration of anything that could have a name.
@@ -326,12 +335,14 @@ parmVarDecl() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('recordDecl0')"><a name="recordDecl0Anchor">recordDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="recordDecl0"><pre>Matches C++ class declarations.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('recordDecl0')"><a name="recordDecl0Anchor">recordDecl</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="recordDecl0"><pre>Matches class, struct, and union declarations.
-Example matches X, Z
+Example matches X, Z, U, and S
class X;
template<class T> class Z {};
+ struct S {};
+ union U {};
</pre></td></tr>
@@ -466,14 +477,6 @@ nestedNameSpecifier() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('CUDAKernelCallExpr0')"><a name="CUDAKernelCallExpr0Anchor">CUDAKernelCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CUDAKernelCallExpr.html">CUDAKernelCallExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="CUDAKernelCallExpr0"><pre>Matches CUDA kernel call expression.
-
-Example matches,
- kernel<<<i,j>>>();
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('arraySubscriptExpr0')"><a name="arraySubscriptExpr0Anchor">arraySubscriptExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ArraySubscriptExpr.html">ArraySubscriptExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="arraySubscriptExpr0"><pre>Matches array subscript expressions.
@@ -502,24 +505,6 @@ Example matches a || b </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('bindTemporaryExpr0')"><a name="bindTemporaryExpr0Anchor">bindTemporaryExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="bindTemporaryExpr0"><pre>Matches nodes where temporaries are created.
-
-Example matches FunctionTakesString(GetStringByValue())
- (matcher = bindTemporaryExpr())
- FunctionTakesString(GetStringByValue());
- FunctionTakesStringByPointer(GetStringPointer());
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('boolLiteral0')"><a name="boolLiteral0Anchor">boolLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="boolLiteral0"><pre>Matches bool literals.
-
-Example matches true
- true
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('breakStmt0')"><a name="breakStmt0Anchor">breakStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1BreakStmt.html">BreakStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="breakStmt0"><pre>Matches break statements.
@@ -571,15 +556,6 @@ but does not match </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('catchStmt0')"><a name="catchStmt0Anchor">catchStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="catchStmt0"><pre>Matches catch statements.
-
- try {} catch(int i) {}
-catchStmt()
- matches 'catch(int i)'
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('characterLiteral0')"><a name="characterLiteral0Anchor">characterLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="characterLiteral0"><pre>Matches character literals (also matches wchar_t).
@@ -615,8 +591,53 @@ Example matches a ? b : c </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('constCastExpr0')"><a name="constCastExpr0Anchor">constCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="constCastExpr0"><pre>Matches a const_cast expression.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('continueStmt0')"><a name="continueStmt0Anchor">continueStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ContinueStmt.html">ContinueStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="continueStmt0"><pre>Matches continue statements.
+
+Given
+ while (true) { continue; }
+continueStmt()
+ matches 'continue'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cudaKernelCallExpr0')"><a name="cudaKernelCallExpr0Anchor">cudaKernelCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CUDAKernelCallExpr.html">CUDAKernelCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cudaKernelCallExpr0"><pre>Matches CUDA kernel call expression.
+
+Example matches,
+ kernel<<<i,j>>>();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxBindTemporaryExpr0')"><a name="cxxBindTemporaryExpr0Anchor">cxxBindTemporaryExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBindTemporaryExpr.html">CXXBindTemporaryExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxBindTemporaryExpr0"><pre>Matches nodes where temporaries are created.
+
+Example matches FunctionTakesString(GetStringByValue())
+ (matcher = cxxBindTemporaryExpr())
+ FunctionTakesString(GetStringByValue());
+ FunctionTakesStringByPointer(GetStringPointer());
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxBoolLiteral0')"><a name="cxxBoolLiteral0Anchor">cxxBoolLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXBoolLiteralExpr.html">CXXBoolLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxBoolLiteral0"><pre>Matches bool literals.
+
+Example matches true
+ true
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxCatchStmt0')"><a name="cxxCatchStmt0Anchor">cxxCatchStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCatchStmt.html">CXXCatchStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxCatchStmt0"><pre>Matches catch statements.
+
+ try {} catch(int i) {}
+cxxCatchStmt()
+ matches 'catch(int i)'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxConstCastExpr0')"><a name="cxxConstCastExpr0Anchor">cxxConstCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstCastExpr.html">CXXConstCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstCastExpr0"><pre>Matches a const_cast expression.
Example: Matches const_cast<int*>(&r) in
int n = 42;
@@ -625,11 +646,11 @@ Example: Matches const_cast<int*>(&r) in </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('constructExpr0')"><a name="constructExpr0Anchor">constructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="constructExpr0"><pre>Matches constructor call expressions (including implicit ones).
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxConstructExpr0')"><a name="cxxConstructExpr0Anchor">cxxConstructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructExpr.html">CXXConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxConstructExpr0"><pre>Matches constructor call expressions (including implicit ones).
Example matches string(ptr, n) and ptr within arguments of f
- (matcher = constructExpr())
+ (matcher = cxxConstructExpr())
void f(const string &a, const string &b);
char *ptr;
int n;
@@ -637,13 +658,172 @@ Example matches string(ptr, n) and ptr within arguments of f </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('continueStmt0')"><a name="continueStmt0Anchor">continueStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ContinueStmt.html">ContinueStmt</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="continueStmt0"><pre>Matches continue statements.
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDefaultArgExpr0')"><a name="cxxDefaultArgExpr0Anchor">cxxDefaultArgExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDefaultArgExpr0"><pre>Matches the value of a default argument at the call site.
+
+Example matches the CXXDefaultArgExpr placeholder inserted for the
+ default value of the second parameter in the call expression f(42)
+ (matcher = cxxDefaultArgExpr())
+ void f(int x, int y = 0);
+ f(42);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDeleteExpr0')"><a name="cxxDeleteExpr0Anchor">cxxDeleteExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDeleteExpr.html">CXXDeleteExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDeleteExpr0"><pre>Matches delete expressions.
Given
- while (true) { continue; }
-continueStmt()
- matches 'continue'
+ delete X;
+cxxDeleteExpr()
+ matches 'delete X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxDynamicCastExpr0')"><a name="cxxDynamicCastExpr0Anchor">cxxDynamicCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxDynamicCastExpr0"><pre>Matches a dynamic_cast expression.
+
+Example:
+ cxxDynamicCastExpr()
+matches
+ dynamic_cast<D*>(&b);
+in
+ struct B { virtual ~B() {} }; struct D : B {};
+ B b;
+ D* p = dynamic_cast<D*>(&b);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxForRangeStmt0')"><a name="cxxForRangeStmt0Anchor">cxxForRangeStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxForRangeStmt0"><pre>Matches range-based for statements.
+
+cxxForRangeStmt() matches 'for (auto a : i)'
+ int i[] = {1, 2, 3}; for (auto a : i);
+ for(int j = 0; j < 5; ++j);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxFunctionalCastExpr0')"><a name="cxxFunctionalCastExpr0Anchor">cxxFunctionalCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxFunctionalCastExpr0"><pre>Matches functional cast expressions
+
+Example: Matches Foo(bar);
+ Foo f = bar;
+ Foo g = (Foo) bar;
+ Foo h = Foo(bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxMemberCallExpr0')"><a name="cxxMemberCallExpr0Anchor">cxxMemberCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxMemberCallExpr0"><pre>Matches member call expressions.
+
+Example matches x.y()
+ X x;
+ x.y();
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxNewExpr0')"><a name="cxxNewExpr0Anchor">cxxNewExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxNewExpr0"><pre>Matches new expressions.
+
+Given
+ new X;
+cxxNewExpr()
+ matches 'new X'.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxNullPtrLiteralExpr0')"><a name="cxxNullPtrLiteralExpr0Anchor">cxxNullPtrLiteralExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNullPtrLiteralExpr.html">CXXNullPtrLiteralExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxNullPtrLiteralExpr0"><pre>Matches nullptr literal.
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxOperatorCallExpr0')"><a name="cxxOperatorCallExpr0Anchor">cxxOperatorCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxOperatorCallExpr0"><pre>Matches overloaded operator calls.
+
+Note that if an operator isn't overloaded, it won't match. Instead, use
+binaryOperator matcher.
+Currently it does not match operators such as new delete.
+FIXME: figure out why these do not match?
+
+Example matches both operator<<((o << b), c) and operator<<(o, b)
+ (matcher = cxxOperatorCallExpr())
+ ostream &operator<< (ostream &out, int i) { };
+ ostream &o; int b = 1, c = 1;
+ o << b << c;
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxReinterpretCastExpr0')"><a name="cxxReinterpretCastExpr0Anchor">cxxReinterpretCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxReinterpretCastExpr0"><pre>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);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxStaticCastExpr0')"><a name="cxxStaticCastExpr0Anchor">cxxStaticCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxStaticCastExpr0"><pre>Matches a C++ static_cast expression.
+
+hasDestinationType
+reinterpretCast
+
+Example:
+ cxxStaticCastExpr()
+matches
+ static_cast<long>(8)
+in
+ long eight(static_cast<long>(8));
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxTemporaryObjectExpr0')"><a name="cxxTemporaryObjectExpr0Anchor">cxxTemporaryObjectExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTemporaryObjectExpr.html">CXXTemporaryObjectExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxTemporaryObjectExpr0"><pre>Matches functional cast expressions having N != 1 arguments
+
+Example: Matches Foo(bar, bar)
+ Foo h = Foo(bar, bar);
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxThisExpr0')"><a name="cxxThisExpr0Anchor">cxxThisExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThisExpr.html">CXXThisExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxThisExpr0"><pre>Matches implicit and explicit this expressions.
+
+Example matches the implicit this expression in "return i".
+ (matcher = cxxThisExpr())
+struct foo {
+ int i;
+ int f() { return i; }
+};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxThrowExpr0')"><a name="cxxThrowExpr0Anchor">cxxThrowExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThrowExpr.html">CXXThrowExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxThrowExpr0"><pre>Matches throw expressions.
+
+ try { throw 5; } catch(int i) {}
+cxxThrowExpr()
+ matches 'throw 5'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxTryStmt0')"><a name="cxxTryStmt0Anchor">cxxTryStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTryStmt.html">CXXTryStmt</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxTryStmt0"><pre>Matches try statements.
+
+ try {} catch(int i) {}
+cxxTryStmt()
+ matches 'try {}'
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('cxxUnresolvedConstructExpr0')"><a name="cxxUnresolvedConstructExpr0Anchor">cxxUnresolvedConstructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXUnresolvedConstructExpr.html">CXXUnresolvedConstructExpr</a>>...</td></tr>
+<tr><td colspan="4" class="doc" id="cxxUnresolvedConstructExpr0"><pre>Matches unresolved constructor call expressions.
+
+Example matches T(t) in return statement of f
+ (matcher = cxxUnresolvedConstructExpr())
+ template <typename T>
+ void f(const T& t) { return T(t); }
</pre></td></tr>
@@ -666,17 +846,6 @@ declStmt() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultArgExpr0')"><a name="defaultArgExpr0Anchor">defaultArgExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDefaultArgExpr.html">CXXDefaultArgExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="defaultArgExpr0"><pre>Matches the value of a default argument at the call site.
-
-Example matches the CXXDefaultArgExpr placeholder inserted for the
- default value of the second parameter in the call expression f(42)
- (matcher = defaultArgExpr())
- void f(int x, int y = 0);
- f(42);
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('defaultStmt0')"><a name="defaultStmt0Anchor">defaultStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DefaultStmt.html">DefaultStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="defaultStmt0"><pre>Matches default statements inside switch statements.
@@ -687,16 +856,6 @@ defaultStmt() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('deleteExpr0')"><a name="deleteExpr0Anchor">deleteExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDeleteExpr.html">CXXDeleteExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="deleteExpr0"><pre>Matches delete expressions.
-
-Given
- delete X;
-deleteExpr()
- matches 'delete X'.
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('doStmt0')"><a name="doStmt0Anchor">doStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="doStmt0"><pre>Matches do statements.
@@ -707,20 +866,6 @@ doStmt() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('dynamicCastExpr0')"><a name="dynamicCastExpr0Anchor">dynamicCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXDynamicCastExpr.html">CXXDynamicCastExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="dynamicCastExpr0"><pre>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);
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('explicitCastExpr0')"><a name="explicitCastExpr0Anchor">explicitCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ExplicitCastExpr.html">ExplicitCastExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="explicitCastExpr0"><pre>Matches explicit cast expressions.
@@ -768,15 +913,6 @@ Does not match implicit conversions such as </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forRangeStmt0')"><a name="forRangeStmt0Anchor">forRangeStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="forRangeStmt0"><pre>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);
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('forStmt0')"><a name="forStmt0Anchor">forStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="forStmt0"><pre>Matches for statements.
@@ -786,16 +922,6 @@ Example matches 'for (;;) {}' </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('functionalCastExpr0')"><a name="functionalCastExpr0Anchor">functionalCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXFunctionalCastExpr.html">CXXFunctionalCastExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="functionalCastExpr0"><pre>Matches functional cast expressions
-
-Example: Matches Foo(bar);
- Foo f = bar;
- Foo g = (Foo) bar;
- Foo h = Foo(bar);
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('gnuNullExpr0')"><a name="gnuNullExpr0Anchor">gnuNullExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1GNUNullExpr.html">GNUNullExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="gnuNullExpr0"><pre>Matches GNU __null expression.
</pre></td></tr>
@@ -883,15 +1009,6 @@ but does not match </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberCallExpr0')"><a name="memberCallExpr0Anchor">memberCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXMemberCallExpr.html">CXXMemberCallExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="memberCallExpr0"><pre>Matches member call expressions.
-
-Example matches x.y()
- X x;
- x.y();
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('memberExpr0')"><a name="memberExpr0Anchor">memberExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1MemberExpr.html">MemberExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="memberExpr0"><pre>Matches member expressions.
@@ -905,21 +1022,6 @@ memberExpr() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('newExpr0')"><a name="newExpr0Anchor">newExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNewExpr.html">CXXNewExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="newExpr0"><pre>Matches new expressions.
-
-Given
- new X;
-newExpr()
- matches 'new X'.
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('nullPtrLiteralExpr0')"><a name="nullPtrLiteralExpr0Anchor">nullPtrLiteralExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXNullPtrLiteralExpr.html">CXXNullPtrLiteralExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="nullPtrLiteralExpr0"><pre>Matches nullptr literal.
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('nullStmt0')"><a name="nullStmt0Anchor">nullStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1NullStmt.html">NullStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="nullStmt0"><pre>Matches null statements.
@@ -940,34 +1042,6 @@ NSString's "alloc". This matcher should match both message sends. </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('operatorCallExpr0')"><a name="operatorCallExpr0Anchor">operatorCallExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="operatorCallExpr0"><pre>Matches overloaded operator calls.
-
-Note that if an operator isn't overloaded, it won't match. Instead, use
-binaryOperator matcher.
-Currently it does not match operators such as new delete.
-FIXME: figure out why these do not match?
-
-Example matches both operator<<((o << b), c) and operator<<(o, b)
- (matcher = operatorCallExpr())
- ostream &operator<< (ostream &out, int i) { };
- ostream &o; int b = 1, c = 1;
- o << b << c;
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('reinterpretCastExpr0')"><a name="reinterpretCastExpr0Anchor">reinterpretCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXReinterpretCastExpr.html">CXXReinterpretCastExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="reinterpretCastExpr0"><pre>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);
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('returnStmt0')"><a name="returnStmt0Anchor">returnStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ReturnStmt.html">ReturnStmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="returnStmt0"><pre>Matches return statements.
@@ -978,21 +1052,6 @@ returnStmt() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('staticCastExpr0')"><a name="staticCastExpr0Anchor">staticCastExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXStaticCastExpr.html">CXXStaticCastExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="staticCastExpr0"><pre>Matches a C++ static_cast expression.
-
-hasDestinationType
-reinterpretCast
-
-Example:
- staticCastExpr()
-matches
- static_cast<long>(8)
-in
- long eight(static_cast<long>(8));
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('stmt0')"><a name="stmt0Anchor">stmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="stmt0"><pre>Matches statements.
@@ -1043,44 +1102,6 @@ switchStmt() </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('temporaryObjectExpr0')"><a name="temporaryObjectExpr0Anchor">temporaryObjectExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTemporaryObjectExpr.html">CXXTemporaryObjectExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="temporaryObjectExpr0"><pre>Matches functional cast expressions having N != 1 arguments
-
-Example: Matches Foo(bar, bar)
- Foo h = Foo(bar, bar);
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('thisExpr0')"><a name="thisExpr0Anchor">thisExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThisExpr.html">CXXThisExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="thisExpr0"><pre>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; }
-};
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('throwExpr0')"><a name="throwExpr0Anchor">throwExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXThrowExpr.html">CXXThrowExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="throwExpr0"><pre>Matches throw expressions.
-
- try { throw 5; } catch(int i) {}
-throwExpr()
- matches 'throw 5'
-</pre></td></tr>
-
-
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('tryStmt0')"><a name="tryStmt0Anchor">tryStmt</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXTryStmt.html">CXXTryStmt</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="tryStmt0"><pre>Matches try statements.
-
- try {} catch(int i) {}
-tryStmt()
- matches 'try {}'
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unaryExprOrTypeTraitExpr0')"><a name="unaryExprOrTypeTraitExpr0Anchor">unaryExprOrTypeTraitExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryExprOrTypeTraitExpr.html">UnaryExprOrTypeTraitExpr</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="unaryExprOrTypeTraitExpr0"><pre>Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL)
@@ -1100,16 +1121,6 @@ Example matches !a </pre></td></tr>
-<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('unresolvedConstructExpr0')"><a name="unresolvedConstructExpr0Anchor">unresolvedConstructExpr</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXUnresolvedConstructExpr.html">CXXUnresolvedConstructExpr</a>>...</td></tr>
-<tr><td colspan="4" class="doc" id="unresolvedConstructExpr0"><pre>Matches unresolved constructor call expressions.
-
-Example matches T(t) in return statement of f
- (matcher = unresolvedConstructExpr())
- template <typename T>
- void f(const T& t) { return T(t); }
-</pre></td></tr>
-
-
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('userDefinedLiteral0')"><a name="userDefinedLiteral0Anchor">userDefinedLiteral</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UserDefinedLiteral.html">UserDefinedLiteral</a>>...</td></tr>
<tr><td colspan="4" class="doc" id="userDefinedLiteral0"><pre>Matches user defined literal operator call.
@@ -1537,7 +1548,7 @@ Usable as: Any Matcher <tr><td>Matcher<*></td><td class="name" onclick="toggle('unless0')"><a name="unless0Anchor">unless</a></td><td>Matcher<*></td></tr>
<tr><td colspan="4" class="doc" id="unless0"><pre>Matches if the provided matcher does not match.
-Example matches Y (matcher = recordDecl(unless(hasName("X"))))
+Example matches Y (matcher = cxxRecordDecl(unless(hasName("X"))))
class X {};
class Y {};
@@ -1557,7 +1568,7 @@ Example matches a || b (matcher = binaryOperator(hasOperatorName("||"))) <tr><td>Matcher<CXXBoolLiteral></td><td class="name" onclick="toggle('equals2')"><a name="equals2Anchor">equals</a></td><td>ValueT Value</td></tr>
<tr><td colspan="4" class="doc" id="equals2"><pre>Matches literals that are equal to the given value.
-Example matches true (matcher = boolLiteral(equals(true)))
+Example matches true (matcher = cxxBoolLiteral(equals(true)))
true
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
@@ -1577,7 +1588,7 @@ Given ...
}
endcode
-catchStmt(isCatchAll()) matches catch(...) but not catch(int).
+cxxCatchStmt(isCatchAll()) matches catch(...) but not catch(int).
</pre></td></tr>
@@ -1605,7 +1616,7 @@ Given S(const S &); #2
S(S &&); #3
};
-constructorDecl(isCopyConstructor()) will match #2, but not #1 or #3.
+cxxConstructorDecl(isCopyConstructor()) will match #2, but not #1 or #3.
</pre></td></tr>
@@ -1618,7 +1629,7 @@ Given S(const S &); #2
S(S &&); #3
};
-constructorDecl(isDefaultConstructor()) will match #1, but not #2 or #3.
+cxxConstructorDecl(isDefaultConstructor()) will match #1, but not #2 or #3.
</pre></td></tr>
@@ -1633,8 +1644,8 @@ Given operator int(); #3
explicit operator bool(); #4
};
-constructorDecl(isExplicit()) will match #2, but not #1.
-conversionDecl(isExplicit()) will match #4, but not #3.
+cxxConstructorDecl(isExplicit()) will match #2, but not #1.
+cxxConversionDecl(isExplicit()) will match #4, but not #3.
</pre></td></tr>
@@ -1647,7 +1658,7 @@ Given S(const S &); #2
S(S &&); #3
};
-constructorDecl(isMoveConstructor()) will match #3, but not #1 or #2.
+cxxConstructorDecl(isMoveConstructor()) will match #3, but not #1 or #2.
</pre></td></tr>
@@ -1662,8 +1673,8 @@ Given operator int(); #3
explicit operator bool(); #4
};
-constructorDecl(isExplicit()) will match #2, but not #1.
-conversionDecl(isExplicit()) will match #4, but not #3.
+cxxConstructorDecl(isExplicit()) will match #2, but not #1.
+cxxConversionDecl(isExplicit()) will match #4, but not #3.
</pre></td></tr>
@@ -1680,7 +1691,7 @@ Given struct E : B {
E() : B() {}
};
-constructorDecl(hasAnyConstructorInitializer(isBaseInitializer()))
+cxxConstructorDecl(hasAnyConstructorInitializer(isBaseInitializer()))
will match E(), but not match D(int).
</pre></td></tr>
@@ -1698,7 +1709,7 @@ Given struct E : B {
E() : B() {}
};
-constructorDecl(hasAnyConstructorInitializer(isMemberInitializer()))
+cxxConstructorDecl(hasAnyConstructorInitializer(isMemberInitializer()))
will match D(int), but not match E().
</pre></td></tr>
@@ -1713,7 +1724,7 @@ Given Foo(int) : foo_("A") { }
string foo_;
};
-constructorDecl(hasAnyConstructorInitializer(isWritten()))
+cxxConstructorDecl(hasAnyConstructorInitializer(isWritten()))
will match Foo(int), but not Foo()
</pre></td></tr>
@@ -1727,7 +1738,7 @@ struct A { void bar();
};
-methodDecl(isConst()) matches A::foo() but not A::bar()
+cxxMethodDecl(isConst()) matches A::foo() but not A::bar()
</pre></td></tr>
@@ -1800,9 +1811,10 @@ Given: A a;
a << a; <-- This matches
-operatorCallExpr(hasOverloadedOperatorName("<<"))) matches the specified
-line and recordDecl(hasMethod(hasOverloadedOperatorName("*"))) matches
-the declaration of A.
+cxxOperatorCallExpr(hasOverloadedOperatorName("<<"))) matches the
+specified line and
+cxxRecordDecl(hasMethod(hasOverloadedOperatorName("*")))
+matches the declaration of A.
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
</pre></td></tr>
@@ -1858,13 +1870,13 @@ Given template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.
But given
template <typename T> class X {}; class A {};
template <> class X<A> {}; X<A> x;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
does not match, as X<A> is an explicit template specialization.
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
@@ -1884,7 +1896,7 @@ Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2))) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>></td><td class="name" onclick="toggle('equals3')"><a name="equals3Anchor">equals</a></td><td>ValueT Value</td></tr>
<tr><td colspan="4" class="doc" id="equals3"><pre>Matches literals that are equal to the given value.
-Example matches true (matcher = boolLiteral(equals(true)))
+Example matches true (matcher = cxxBoolLiteral(equals(true)))
true
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
@@ -1947,7 +1959,7 @@ Matches a node if it equals the node previously bound to ID. Given
class X { int a; int b; };
-recordDecl(
+cxxRecordDecl(
has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
matches the class X, as a and b have the same type.
@@ -1979,7 +1991,7 @@ passed as a quoted string. e.g., hasAttr("attr::CUDADevice"). partially matching a given regex.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
+ (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
#include "ASTMatcher.h"
class X {};
ASTMatcher.h:
@@ -1992,7 +2004,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.html">Decl</a>></td><td class="name" onclick="toggle('isExpansionInMainFile0')"><a name="isExpansionInMainFile0Anchor">isExpansionInMainFile</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isExpansionInMainFile0"><pre>Matches AST nodes that were expanded within the main-file.
-Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
+Example matches X but not Y
+ (matcher = cxxRecordDecl(isExpansionInMainFile())
#include <Y.h>
class X {};
Y.h:
@@ -2006,7 +2019,7 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td colspan="4" class="doc" id="isExpansionInSystemHeader0"><pre>Matches AST nodes that were expanded within system-header-files.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInSystemHeader())
+ (matcher = cxxRecordDecl(isExpansionInSystemHeader())
#include <SystemHeader.h>
class X {};
SystemHeader.h:
@@ -2067,7 +2080,7 @@ fieldDecl(isPublic()) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FloatingLiteral.html">FloatingLiteral</a>></td><td class="name" onclick="toggle('equals1')"><a name="equals1Anchor">equals</a></td><td>ValueT Value</td></tr>
<tr><td colspan="4" class="doc" id="equals1"><pre>Matches literals that are equal to the given value.
-Example matches true (matcher = boolLiteral(equals(true)))
+Example matches true (matcher = cxxBoolLiteral(equals(true)))
true
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
@@ -2087,9 +2100,10 @@ Given: A a;
a << a; <-- This matches
-operatorCallExpr(hasOverloadedOperatorName("<<"))) matches the specified
-line and recordDecl(hasMethod(hasOverloadedOperatorName("*"))) matches
-the declaration of A.
+cxxOperatorCallExpr(hasOverloadedOperatorName("<<"))) matches the
+specified line and
+cxxRecordDecl(hasMethod(hasOverloadedOperatorName("*")))
+matches the declaration of A.
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXOperatorCallExpr.html">CXXOperatorCallExpr</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>
</pre></td></tr>
@@ -2183,13 +2197,13 @@ Given template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.
But given
template <typename T> class X {}; class A {};
template <> class X<A> {}; X<A> x;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
does not match, as X<A> is an explicit template specialization.
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
@@ -2210,7 +2224,7 @@ functionDecl(parameterCountIs(2)) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1IntegerLiteral.html">IntegerLiteral</a>></td><td class="name" onclick="toggle('equals0')"><a name="equals0Anchor">equals</a></td><td>ValueT Value</td></tr>
<tr><td colspan="4" class="doc" id="equals0"><pre>Matches literals that are equal to the given value.
-Example matches true (matcher = boolLiteral(equals(true)))
+Example matches true (matcher = cxxBoolLiteral(equals(true)))
true
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CharacterLiteral.html">CharacterLiteral</a>>, Matcher<CXXBoolLiteral>,
@@ -2303,7 +2317,17 @@ Example matches f(0, 0) (matcher = callExpr(argumentCountIs(2))) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasKeywordSelector0')"><a name="hasKeywordSelector0Anchor">hasKeywordSelector</a></td><td></td></tr>
-<tr><td colspan="4" class="doc" id="hasKeywordSelector0"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasKeywordSelector0"><pre>Matches when the selector is a keyword selector
+
+objCMessageExpr(hasKeywordSelector()) matches the generated setFrame
+message expression in
+
+ UIWebView *webView = ...;
+ CGRect bodyFrame = webView.frame;
+ bodyFrame.size.height = self.bodyContentHeight;
+ webView.frame = bodyFrame;
+ ^---- matches here
+</pre></td></tr>
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1ObjCMessageExpr.html">ObjCMessageExpr</a>></td><td class="name" onclick="toggle('hasNullSelector0')"><a name="hasNullSelector0Anchor">hasNullSelector</a></td><td></td></tr>
@@ -2362,7 +2386,7 @@ a substring matched by the given RegExp. Given
class Y { public: void x(); };
void z() { Y* y; y->x(); }
-memberCallExpr(on(hasType(asString("class Y *"))))
+cxxMemberCallExpr(on(hasType(asString("class Y *"))))
matches y->x()
</pre></td></tr>
@@ -2374,7 +2398,7 @@ Matches a node if it equals the node previously bound to ID. Given
class X { int a; int b; };
-recordDecl(
+cxxRecordDecl(
has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
matches the class X, as a and b have the same type.
@@ -2434,6 +2458,36 @@ matches "a(int)", "b(long)", but not "c(double)". </pre></td></tr>
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isClass0')"><a name="isClass0Anchor">isClass</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isClass0"><pre>Matches RecordDecl object that are spelled with "class."
+
+Example matches C, but not S or U.
+ struct S {};
+ class C {};
+ union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isStruct0')"><a name="isStruct0Anchor">isStruct</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isStruct0"><pre>Matches RecordDecl object that are spelled with "struct."
+
+Example matches S, but not C or U.
+ struct S {};
+ class C {};
+ union U {};
+</pre></td></tr>
+
+
+<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1RecordDecl.html">RecordDecl</a>></td><td class="name" onclick="toggle('isUnion0')"><a name="isUnion0Anchor">isUnion</a></td><td></td></tr>
+<tr><td colspan="4" class="doc" id="isUnion0"><pre>Matches RecordDecl object that are spelled with "union."
+
+Example matches U, but not C or S.
+ struct S {};
+ class C {};
+ union U {};
+</pre></td></tr>
+
+
<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('equalsBoundNode0')"><a name="equalsBoundNode0Anchor">equalsBoundNode</a></td><td>std::string ID</td></tr>
<tr><td colspan="4" class="doc" id="equalsBoundNode0"><pre>Matches if a node equals a previously bound node.
@@ -2441,7 +2495,7 @@ Matches a node if it equals the node previously bound to ID. Given
class X { int a; int b; };
-recordDecl(
+cxxRecordDecl(
has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
matches the class X, as a and b have the same type.
@@ -2462,7 +2516,7 @@ and reference to that variable declaration within a compound statement. partially matching a given regex.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
+ (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
#include "ASTMatcher.h"
class X {};
ASTMatcher.h:
@@ -2475,7 +2529,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('isExpansionInMainFile1')"><a name="isExpansionInMainFile1Anchor">isExpansionInMainFile</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isExpansionInMainFile1"><pre>Matches AST nodes that were expanded within the main-file.
-Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
+Example matches X but not Y
+ (matcher = cxxRecordDecl(isExpansionInMainFile())
#include <Y.h>
class X {};
Y.h:
@@ -2489,7 +2544,7 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td colspan="4" class="doc" id="isExpansionInSystemHeader1"><pre>Matches AST nodes that were expanded within system-header-files.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInSystemHeader())
+ (matcher = cxxRecordDecl(isExpansionInSystemHeader())
#include <SystemHeader.h>
class X {};
SystemHeader.h:
@@ -2559,7 +2614,7 @@ classTemplateSpecializationDecl(templateArgumentCountIs(1)) partially matching a given regex.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInFileMatching("AST.*"))
+ (matcher = cxxRecordDecl(isExpansionInFileMatching("AST.*"))
#include "ASTMatcher.h"
class X {};
ASTMatcher.h:
@@ -2572,7 +2627,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1TypeLoc.html">TypeLoc</a>></td><td class="name" onclick="toggle('isExpansionInMainFile2')"><a name="isExpansionInMainFile2Anchor">isExpansionInMainFile</a></td><td></td></tr>
<tr><td colspan="4" class="doc" id="isExpansionInMainFile2"><pre>Matches AST nodes that were expanded within the main-file.
-Example matches X but not Y (matcher = recordDecl(isExpansionInMainFile())
+Example matches X but not Y
+ (matcher = cxxRecordDecl(isExpansionInMainFile())
#include <Y.h>
class X {};
Y.h:
@@ -2586,7 +2642,7 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Decl.h <tr><td colspan="4" class="doc" id="isExpansionInSystemHeader2"><pre>Matches AST nodes that were expanded within system-header-files.
Example matches Y but not X
- (matcher = recordDecl(isExpansionInSystemHeader())
+ (matcher = cxxRecordDecl(isExpansionInSystemHeader())
#include <SystemHeader.h>
class X {};
SystemHeader.h:
@@ -2603,7 +2659,7 @@ Matches a node if it equals the node previously bound to ID. Given
class X { int a; int b; };
-recordDecl(
+cxxRecordDecl(
has(fieldDecl(hasName("a"), hasType(type().bind("t")))),
has(fieldDecl(hasName("b"), hasType(type(equalsBoundNode("t"))))))
matches the class X, as a and b have the same type.
@@ -2737,13 +2793,13 @@ Given template <typename T> class X {}; class A {}; X<A> x;
or
template <typename T> class X {}; class A {}; template class X<A>;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
matches the template instantiation of X<A>.
But given
template <typename T> class X {}; class A {};
template <> class X<A> {}; X<A> x;
-recordDecl(hasName("::X"), isTemplateInstantiation())
+cxxRecordDecl(hasName("::X"), isTemplateInstantiation())
does not match, as X<A> is an explicit template specialization.
Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1VarDecl.html">VarDecl</a>>, Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXRecordDecl.html">CXXRecordDecl</a>>
@@ -2805,8 +2861,8 @@ matching submatcher. For example, in:
class A { int a; int b; };
The matcher:
- recordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
- has(fieldDecl(hasName("b")).bind("v"))))
+ cxxRecordDecl(eachOf(has(fieldDecl(hasName("a")).bind("v")),
+ has(fieldDecl(hasName("b")).bind("v"))))
will generate two results binding "v", the first of which binds
the field declaration of a, the second the field declaration of
b.
@@ -2820,7 +2876,7 @@ Usable as: Any Matcher provided matcher.
Example matches X, A, B, C
- (matcher = recordDecl(forEachDescendant(recordDecl(hasName("X")))))
+ (matcher = cxxRecordDecl(forEachDescendant(cxxRecordDecl(hasName("X")))))
class X {}; Matches X, because X::X is a class of name X inside X.
class A { class X {}; };
class B { class C { class X {}; }; };
@@ -2831,7 +2887,9 @@ As opposed to 'hasDescendant', 'forEachDescendant' will cause a match for each result that matches instead of only on the first one.
Note: Recursively combined ForEachDescendant can cause many matches:
- recordDecl(forEachDescendant(recordDecl(forEachDescendant(recordDecl()))))
+ cxxRecordDecl(forEachDescendant(cxxRecordDecl(
+ forEachDescendant(cxxRecordDecl())
+ )))
will match 10 times (plus injected class name matches) on:
class A { class B { class C { class D { class E {}; }; }; }; };
@@ -2843,7 +2901,8 @@ Usable as: Any Matcher <tr><td colspan="4" class="doc" id="forEach0"><pre>Matches AST nodes that have child AST nodes that match the
provided matcher.
-Example matches X, Y (matcher = recordDecl(forEach(recordDecl(hasName("X")))
+Example matches X, Y
+ (matcher = cxxRecordDecl(forEach(cxxRecordDecl(hasName("X")))
class X {}; Matches X, because X::X is a class of name X inside X.
class Y { class X {}; };
class Z { class Y { class X {}; }; }; Does not match Z.
@@ -2875,7 +2934,7 @@ Usable as: Any Matcher provided matcher.
Example matches X, Y, Z
- (matcher = recordDecl(hasDescendant(recordDecl(hasName("X")))))
+ (matcher = cxxRecordDecl(hasDescendant(cxxRecordDecl(hasName("X")))))
class X {}; Matches X, because X::X is a class of name X inside X.
class Y { class X {}; };
class Z { class Y { class X {}; }; };
@@ -2890,7 +2949,8 @@ Usable as: Any Matcher <tr><td colspan="4" class="doc" id="has0"><pre>Matches AST nodes that have child AST nodes that match the
provided matcher.
-Example matches X, Y (matcher = recordDecl(has(recordDecl(hasName("X")))
+Example matches X, Y
+ (matcher = cxxRecordDecl(has(cxxRecordDecl(hasName("X")))
class X {}; Matches X, because X::X is a class of name X inside X.
class Y { class X {}; };
class Z { class Y { class X {}; }; }; Does not match Z.
@@ -3117,7 +3177,9 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallEx Given
class A { A() : i(42), j(42) {} int i; int j; };
-constructorDecl(forEachConstructorInitializer(forField(decl().bind("x"))))
+cxxConstructorDecl(forEachConstructorInitializer(
+ forField(decl().bind("x"))
+))
will trigger two matches, binding for 'i' and 'j' respectively.
</pre></td></tr>
@@ -3130,7 +3192,9 @@ Given Foo() : foo_(1) { }
int foo_;
};
-recordDecl(has(constructorDecl(hasAnyConstructorInitializer(anything()))))
+cxxRecordDecl(has(cxxConstructorDecl(
+ hasAnyConstructorInitializer(anything())
+)))
record matches Foo, hasAnyConstructorInitializer matches foo_(1)
</pre></td></tr>
@@ -3143,7 +3207,7 @@ Given Foo() : foo_(1) { }
int foo_;
};
-recordDecl(has(constructorDecl(hasAnyConstructorInitializer(
+cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer(
forField(hasName("foo_"))))))
matches Foo
with forField matching foo_
@@ -3158,7 +3222,7 @@ Given Foo() : foo_(1) { }
int foo_;
};
-recordDecl(has(constructorDecl(hasAnyConstructorInitializer(
+cxxRecordDecl(has(cxxConstructorDecl(hasAnyConstructorInitializer(
withInitializer(integerLiteral(equals(1)))))))
matches Foo
with withInitializer matching (1)
@@ -3206,7 +3270,7 @@ matches 'a' in <tr><td colspan="4" class="doc" id="on0"><pre>Matches on the implicit object argument of a member call expression.
Example matches y.x()
- (matcher = memberCallExpr(on(hasType(recordDecl(hasName("Y"))))))
+ (matcher = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("Y"))))))
class Y { public: void x(); };
void z() { Y y; y.x(); }",
@@ -3234,7 +3298,7 @@ FIXME: What other kind of declarations would we need to generalize this to?
Example matches A() in the last line
- (matcher = constructExpr(hasDeclaration(methodDecl(
+ (matcher = cxxConstructExpr(hasDeclaration(cxxMethodDecl(
ofClass(hasName("A"))))))
class A {
public:
@@ -3251,8 +3315,8 @@ Given: class A { void func(); };
class B { void member(); };
-recordDecl(hasMethod(hasName("func"))) matches the declaration of A
-but not B.
+cxxRecordDecl(hasMethod(hasName("func"))) matches the declaration of
+A but not B.
</pre></td></tr>
@@ -3287,7 +3351,8 @@ match Base. <tr><td colspan="4" class="doc" id="callee1"><pre>Matches if the call expression's callee's declaration matches the
given matcher.
-Example matches y.x() (matcher = callExpr(callee(methodDecl(hasName("x")))))
+Example matches y.x() (matcher = callExpr(callee(
+ cxxMethodDecl(hasName("x")))))
class Y { public: void x(); };
void z() { Y y; y.x(); }
</pre></td></tr>
@@ -3376,7 +3441,7 @@ caseStmt(hasCaseConstant(integerLiteral())) <tr><td colspan="4" class="doc" id="hasSourceExpression0"><pre>Matches if the cast's source expression matches the given matcher.
Example: matches "a string" (matcher =
- hasSourceExpression(constructExpr()))
+ hasSourceExpression(cxxConstructExpr()))
class URL { URL(string); };
URL url = "a string";
</pre></td></tr>
@@ -3457,7 +3522,7 @@ with compoundStmt() <tr><td colspan="4" class="doc" id="hasCondition4"><pre>Matches the condition expression of an if statement, for loop,
or conditional operator.
-Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
if (true) {}
</pre></td></tr>
@@ -3579,7 +3644,7 @@ Given }
}
-recordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
+cxxRcordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the
declaration of class D.
</pre></td></tr>
@@ -3601,7 +3666,7 @@ with compoundStmt() <tr><td colspan="4" class="doc" id="hasCondition3"><pre>Matches the condition expression of an if statement, for loop,
or conditional operator.
-Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
if (true) {}
</pre></td></tr>
@@ -3676,12 +3741,12 @@ declaration's type. In case of a value declaration (for example a variable declaration),
this resolves one layer of indirection. For example, in the value
-declaration "X x;", recordDecl(hasName("X")) matches the declaration of X,
-while varDecl(hasType(recordDecl(hasName("X")))) matches the declaration
-of x."
+declaration "X x;", cxxRecordDecl(hasName("X")) matches the declaration of
+X, while varDecl(hasType(cxxRecordDecl(hasName("X")))) matches the
+declaration of x.
-Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
- and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
class X {};
void y(X &x) { x; X z; }
@@ -3693,8 +3758,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.h <tr><td colspan="4" class="doc" id="hasType0"><pre>Matches if the expression's or declaration's type matches a type
matcher.
-Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
- and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
class X {};
void y(X &x) { x; X z; }
</pre></td></tr>
@@ -3782,7 +3847,7 @@ with compoundStmt() <tr><td colspan="4" class="doc" id="hasCondition1"><pre>Matches the condition expression of an if statement, for loop,
or conditional operator.
-Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
if (true) {}
</pre></td></tr>
@@ -3814,7 +3879,7 @@ Does not match the 'this' parameter of a method. Given
class X { void f(int x, int y, int z) {} };
-methodDecl(hasAnyParameter(hasName("y")))
+cxxMethodDecl(hasAnyParameter(hasName("y")))
matches f(int x, int y, int z) {}
with hasAnyParameter(...)
matching int y
@@ -3826,7 +3891,7 @@ with hasAnyParameter(...) Given
class X { void f(int x) {} };
-methodDecl(hasParameter(0, hasType(varDecl())))
+cxxMethodDecl(hasParameter(0, hasType(varDecl())))
matches f(int x) {}
with hasParameter(...)
matching int x
@@ -3838,7 +3903,7 @@ with hasParameter(...) Given:
class X { int f() { return 1; } };
-methodDecl(returns(asString("int")))
+cxxMethodDecl(returns(asString("int")))
matches int f() { return 1; }
</pre></td></tr>
@@ -3847,7 +3912,7 @@ methodDecl(returns(asString("int"))) <tr><td colspan="4" class="doc" id="hasCondition0"><pre>Matches the condition expression of an if statement, for loop,
or conditional operator.
-Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
if (true) {}
</pre></td></tr>
@@ -3866,7 +3931,7 @@ hasConditionVariableStatement(...) <tr><td colspan="4" class="doc" id="hasElse0"><pre>Matches the else-statement of an if statement.
Examples matches the if statement
- (matcher = ifStmt(hasElse(boolLiteral(equals(true)))))
+ (matcher = ifStmt(hasElse(cxxBoolLiteral(equals(true)))))
if (false) false; else true;
</pre></td></tr>
@@ -3875,7 +3940,7 @@ Examples matches the if statement <tr><td colspan="4" class="doc" id="hasThen0"><pre>Matches the then-statement of an if statement.
Examples matches the if statement
- (matcher = ifStmt(hasThen(boolLiteral(equals(true)))))
+ (matcher = ifStmt(hasThen(cxxBoolLiteral(equals(true)))))
if (false) true; else false;
</pre></td></tr>
@@ -3961,7 +4026,7 @@ matched by a given matcher. Given
struct X { int m; };
void f(X x) { x.m; m; }
-memberExpr(hasObjectExpression(hasType(recordDecl(hasName("X")))))))
+memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X")))))))
matches "x.m" and "m"
with hasObjectExpression(...)
matching "x" and the implicit object expression of "m" which has type X*.
@@ -4033,7 +4098,7 @@ Given struct A { struct B { struct C {}; }; };
A::B::C c;
nestedNameSpecifierLoc(specifiesTypeLoc(loc(type(
- hasDeclaration(recordDecl(hasName("A")))))))
+ hasDeclaration(cxxRecordDecl(hasName("A")))))))
matches "A::"
</pre></td></tr>
@@ -4068,7 +4133,9 @@ given QualType matcher without qualifiers. Given
struct A { struct B { struct C {}; }; };
A::B::C c;
-nestedNameSpecifier(specifiesType(hasDeclaration(recordDecl(hasName("A")))))
+nestedNameSpecifier(specifiesType(
+ hasDeclaration(cxxRecordDecl(hasName("A")))
+))
matches "A::"
</pre></td></tr>
@@ -4186,8 +4253,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CallEx matches the specified matcher.
Example matches y->x()
- (matcher = memberCallExpr(on(hasType(pointsTo
- recordDecl(hasName("Y")))))))
+ (matcher = cxxMemberCallExpr(on(hasType(pointsTo
+ cxxRecordDecl(hasName("Y")))))))
class Y { public: void x(); };
void z() { Y *y; y->x(); }
</pre></td></tr>
@@ -4203,7 +4270,7 @@ Example matches y->x() type matches the specified matcher.
Example matches X &x and const X &y
- (matcher = varDecl(hasType(references(recordDecl(hasName("X"))))))
+ (matcher = varDecl(hasType(references(cxxRecordDecl(hasName("X"))))))
class X {
void a(X b) {
X &x = b;
@@ -4448,7 +4515,8 @@ Generates results for each match. For example, in:
class A { class B {}; class C {}; };
The matcher:
- recordDecl(hasName("::A"), findAll(recordDecl(isDefinition()).bind("m")))
+ cxxRecordDecl(hasName("::A"),
+ findAll(cxxRecordDecl(isDefinition()).bind("m")))
will generate results for A, B and C.
Usable as: Any Matcher
@@ -4490,7 +4558,8 @@ unaryExprOrTypeTraitExpr(hasArgumentOfType(asString("int")) <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1UnaryOperator.html">UnaryOperator</a>></td><td class="name" onclick="toggle('hasUnaryOperand0')"><a name="hasUnaryOperand0Anchor">hasUnaryOperand</a></td><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
<tr><td colspan="4" class="doc" id="hasUnaryOperand0"><pre>Matches if the operand of a unary operator matches.
-Example matches true (matcher = hasUnaryOperand(boolLiteral(equals(true))))
+Example matches true (matcher = hasUnaryOperand(
+ cxxBoolLiteral(equals(true))))
!true
</pre></td></tr>
@@ -4545,12 +4614,12 @@ declaration's type. In case of a value declaration (for example a variable declaration),
this resolves one layer of indirection. For example, in the value
-declaration "X x;", recordDecl(hasName("X")) matches the declaration of X,
-while varDecl(hasType(recordDecl(hasName("X")))) matches the declaration
-of x."
+declaration "X x;", cxxRecordDecl(hasName("X")) matches the declaration of
+X, while varDecl(hasType(cxxRecordDecl(hasName("X")))) matches the
+declaration of x.
-Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
- and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
class X {};
void y(X &x) { x; X z; }
@@ -4562,8 +4631,8 @@ Usable as: Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.h <tr><td colspan="4" class="doc" id="hasType1"><pre>Matches if the expression's or declaration's type matches a type
matcher.
-Example matches x (matcher = expr(hasType(recordDecl(hasName("X")))))
- and z (matcher = varDecl(hasType(recordDecl(hasName("X")))))
+Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X")))))
+ and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X")))))
class X {};
void y(X &x) { x; X z; }
</pre></td></tr>
@@ -4610,7 +4679,7 @@ with compoundStmt() <tr><td colspan="4" class="doc" id="hasCondition2"><pre>Matches the condition expression of an if statement, for loop,
or conditional operator.
-Example matches true (matcher = hasCondition(boolLiteral(equals(true))))
+Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
if (true) {}
</pre></td></tr>
|