diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -6544,6 +6544,20 @@ /// void x(int val) {} /// void y(int val = 0) {} /// \endcode +/// +/// Deprecated. Use hasInitializer() instead to be able to +/// match on the contents of the default argument. For example: +/// +/// \code +/// void x(int val = 7) {} +/// void y(int val = 42) {} +/// \endcode +/// parmVarDecl(hasInitializer(integerLiteral(equals(42)))) +/// matches the parameter of y +/// +/// A matcher such as +/// parmVarDecl(hasInitializer(anything())) +/// is equivalent to parmVarDecl(hasDefaultArgument()). AST_MATCHER(ParmVarDecl, hasDefaultArgument) { return Node.hasDefaultArg(); }