diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2016-02-16 21:02:23 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2016-02-16 21:02:23 +0000 |
commit | 3f8756990c0c19c96e2a84fee3455f44b2082828 (patch) | |
tree | ddc674f95cc595a297a6a8143c9a31453055dec1 /docs | |
parent | 7200698a6391999b856a3bb6f008164bb3d27168 (diff) | |
download | clang-3f8756990c0c19c96e2a84fee3455f44b2082828.tar.gz |
Add a nullPointerConstant() AST matcher to handle variations of null pointer constants in one matcher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LibASTMatchersReference.html | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 93408e5776..fc4870433c 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -2176,6 +2176,23 @@ fieldDecl(isPublic()) </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>></td><td class="name" onclick="toggle('nullPointerConstant0')"><a name="nullPointerConstant0Anchor">nullPointerConstant</a></td><td></td></tr> +<tr><td colspan="4" class="doc" id="nullPointerConstant0"><pre>Matches expressions that resolve to a null pointer constant, such as +GNU's __null, C++11's nullptr, or C's NULL macro. + +Given: + void *v1 = NULL; + void *v2 = nullptr; + void *v3 = __null; GNU extension + char *cp = (char *)0; + int *ip = 0; + int i = 0; +expr(nullPointerConstant()) + matches the initializer for v1, v2, v3, cp, and ip. Does not match the + initializer for i. +</pre></td></tr> + + <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. |