summaryrefslogtreecommitdiffstats
path: root/include/clang/ASTMatchers
diff options
context:
space:
mode:
authorSamuel Benzaquen <sbenza@google.com>2016-06-28 14:08:56 +0000
committerSamuel Benzaquen <sbenza@google.com>2016-06-28 14:08:56 +0000
commitcada05da005b642724c9ccecf725ae26c7c8f30c (patch)
tree87b2517acc81b704eac13f1c78b67206408cf02a /include/clang/ASTMatchers
parent09e469bb95e43671457af4f55d39e2b409a9c650 (diff)
[ASTMatchers] Add isLambda() matcher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@274015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/ASTMatchers')
-rw-r--r--include/clang/ASTMatchers/ASTMatchers.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h
index 41080e98e8..c7d10859a5 100644
--- a/include/clang/ASTMatchers/ASTMatchers.h
+++ b/include/clang/ASTMatchers/ASTMatchers.h
@@ -2197,6 +2197,19 @@ AST_MATCHER_P(CXXRecordDecl, hasMethod, internal::Matcher<CXXMethodDecl>,
Node.method_end(), Finder, Builder);
}
+/// \brief Matches the generated class of lambda expressions.
+///
+/// Given:
+/// \code
+/// auto x = []{};
+/// \endcode
+///
+/// \c cxxRecordDecl(isLambda()) matches the implicit class declaration of
+/// \c decltype(x)
+AST_MATCHER(CXXRecordDecl, isLambda) {
+ return Node.isLambda();
+}
+
/// \brief Matches AST nodes that have child AST nodes that match the
/// provided matcher.
///