diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2015-08-11 21:09:52 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2015-08-11 21:09:52 +0000 |
| commit | 6f6d0b6c5a37a42f17591e37a30c911ec1c52898 (patch) | |
| tree | a457a591951a63edbd746ac32a1e420dc0b63f92 /clang/docs | |
| parent | da06bce8b50d47ca841d694e10c12638157b2093 (diff) | |
| download | bcm5719-llvm-6f6d0b6c5a37a42f17591e37a30c911ec1c52898.tar.gz bcm5719-llvm-6f6d0b6c5a37a42f17591e37a30c911ec1c52898.zip | |
Add a polymorphic AST matcher for testing whether a constructor or a conversion declaration is marked as explicit or not.
llvm-svn: 244666
Diffstat (limited to 'clang/docs')
| -rw-r--r-- | clang/docs/LibASTMatchersReference.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 799b47af6fd..954304efbcc 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -1483,6 +1483,19 @@ Example matches #1, but not #2 or #3 (matcher = constructorDecl(isDefaultConstru </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isExplicit0')"><a name="isExplicit0Anchor">isExplicit</a></td><td></td></tr> +<tr><td colspan="4" class="doc" id="isExplicit0"><pre>Matches a constructor declaration if it is marked explicit. + +Given + struct S { + S(int); // #1 + explicit S(double); // #2 + }; +constructorDecl(isExplicit()) + will match #2, but not #1. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConstructorDecl.html">CXXConstructorDecl</a>></td><td class="name" onclick="toggle('isMoveConstructor1')"><a name="isMoveConstructor1Anchor">isMoveConstructor</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isMoveConstructor1"><pre>Matches constructor declarations that are move constructors. @@ -1495,6 +1508,19 @@ Example matches #3, but not #1 or #2 (matcher = constructorDecl(isMoveConstructo </pre></td></tr> +<tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXConversionDecl.html">CXXConversionDecl</a>></td><td class="name" onclick="toggle('isExplicit1')"><a name="isExplicit1Anchor">isExplicit</a></td><td></td></tr> +<tr><td colspan="4" class="doc" id="isExplicit1"><pre>Matches a conversion declaration if it is marked explicit. + +Given + struct S { + operator int(); // #1 + explicit operator bool(); // #2 + }; +conversionDecl(isExplicit()) + will match #2, but not #1. +</pre></td></tr> + + <tr><td>Matcher<<a href="http://clang.llvm.org/doxygen/classclang_1_1CXXCtorInitializer.html">CXXCtorInitializer</a>></td><td class="name" onclick="toggle('isBaseInitializer0')"><a name="isBaseInitializer0Anchor">isBaseInitializer</a></td><td></td></tr> <tr><td colspan="4" class="doc" id="isBaseInitializer0"><pre>Matches a constructor initializer if it is initializing a base, as opposed to a member. |

