summaryrefslogtreecommitdiffstats
path: root/docs/LibASTMatchersReference.html
diff options
context:
space:
mode:
authorHyrum Wright <hwright@google.com>2019-01-07 14:14:36 +0000
committerHyrum Wright <hwright@google.com>2019-01-07 14:14:36 +0000
commitd21770300d16818ce8bd7c5ebbfb79ef323bc5f7 (patch)
tree1547ccb728170778b588d2324f8ea651129773c2 /docs/LibASTMatchersReference.html
parent1aa1a6f871aca22a9dcca8fef4fb49b41cfd3582 (diff)
[clang] Add AST matcher for initializer list members
Summary: Much like hasArg for various call expressions, this allows LibTooling users to match against a member of an initializer list. This is currently being used as part of the abseil-duration-scale clang-tidy check. Differential Revision: https://reviews.llvm.org/D56090 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LibASTMatchersReference.html')
-rw-r--r--docs/LibASTMatchersReference.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html
index 27cb00b6bd..2af0a7c9e3 100644
--- a/docs/LibASTMatchersReference.html
+++ b/docs/LibASTMatchersReference.html
@@ -718,7 +718,7 @@ Example matches a || b
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>&gt;</td><td class="name" onclick="toggle('blockExpr0')"><a name="blockExpr0Anchor">blockExpr</a></td><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1BlockExpr.html">BlockExpr</a>&gt;...</td></tr>
-<tr><td colspan="4" class="doc" id="blockExpr0"><pre>MAtches a reference to a block.
+<tr><td colspan="4" class="doc" id="blockExpr0"><pre>Matches a reference to a block.
Example: matches "^{}":
void f() { ^{}(); }
@@ -5866,6 +5866,15 @@ FIXME: Unit test this matcher
</pre></td></tr>
+<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>&gt;</td><td class="name" onclick="toggle('hasInit0')"><a name="hasInit0Anchor">hasInit</a></td><td>unsigned N, ast_matchers::Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>&gt; InnerMatcher</td></tr>
+<tr><td colspan="4" class="doc" id="hasInit0"><pre>Matches the n'th item of an initializer list expression.
+
+Example matches y.
+ (matcher = initListExpr(hasInit(0, expr())))
+ int x{y}.
+</pre></td></tr>
+
+
<tr><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>&gt;</td><td class="name" onclick="toggle('hasSyntacticForm0')"><a name="hasSyntacticForm0Anchor">hasSyntacticForm</a></td><td>Matcher&lt;<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>&gt; InnerMatcher</td></tr>
<tr><td colspan="4" class="doc" id="hasSyntacticForm0"><pre>Matches the syntactic form of init list expressions
(if expression have it).