diff options
author | Hyrum Wright <hwright@google.com> | 2019-01-07 14:14:36 +0000 |
---|---|---|
committer | Hyrum Wright <hwright@google.com> | 2019-01-07 14:14:36 +0000 |
commit | 2cd40c01703b20e866e5e545dfaca008fda73772 (patch) | |
tree | d0c7e2824bdea8dd51fffe0c169acb777d71d6a3 /clang/docs | |
parent | 9e014b6c3d9d9ff7fac3bf8072f555c270967b92 (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
llvm-svn: 350523
Diffstat (limited to 'clang/docs')
-rw-r--r-- | clang/docs/LibASTMatchersReference.html | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 27cb00b6bdfc..2af0a7c9e33d 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -718,7 +718,7 @@ Example matches a || b <tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>></td><td class="name" onclick="toggle('blockExpr0')"><a name="blockExpr0Anchor">blockExpr</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1BlockExpr.html">BlockExpr</a>>...</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<<a href="https://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>></td><td class="name" onclick="toggle('hasInit0')"><a name="hasInit0Anchor">hasInit</a></td><td>unsigned N, ast_matchers::Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> 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<<a href="https://clang.llvm.org/doxygen/classclang_1_1InitListExpr.html">InitListExpr</a>></td><td class="name" onclick="toggle('hasSyntacticForm0')"><a name="hasSyntacticForm0Anchor">hasSyntacticForm</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr> <tr><td colspan="4" class="doc" id="hasSyntacticForm0"><pre>Matches the syntactic form of init list expressions (if expression have it). |