diff options
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/ASTMatchers/ASTMatchers.h | 14 |
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. /// |

