summaryrefslogtreecommitdiffstats
path: root/clang/include
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-10-05 14:41:27 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-10-05 14:41:27 +0000
commit3fd6c110bea17628828e1d149906312343cac99e (patch)
treed38337773bbf7097f6f37aea836cdf934d94fbe8 /clang/include
parent2b4e14ed588d974985911bf6ad64178f022257b4 (diff)
downloadbcm5719-llvm-3fd6c110bea17628828e1d149906312343cac99e.tar.gz
bcm5719-llvm-3fd6c110bea17628828e1d149906312343cac99e.zip
Adding a narrowing AST matcher for FunctionDecl::isVariadic(), plus tests and documentation.
llvm-svn: 249321
Diffstat (limited to 'clang/include')
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchers.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 5a14eef72a8..cfed1fd16de 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -3255,6 +3255,20 @@ AST_POLYMORPHIC_MATCHER(isDefinition,
return Node.isThisDeclarationADefinition();
}
+/// \brief Matches if a function declaration is variadic.
+///
+/// Example matches f, but not g or h. The function i will not match, even when
+/// compiled in C mode.
+/// \code
+/// void f(...);
+/// void g(int);
+/// template <typename... Ts> void h(Ts...);
+/// void i();
+/// \endcode
+AST_MATCHER(FunctionDecl, isVariadic) {
+ return Node.isVariadic();
+}
+
/// \brief Matches the class declaration that the given method declaration
/// belongs to.
///
OpenPOWER on IntegriCloud