Index: include/clang/ASTMatchers/ASTMatchers.h =================================================================== --- include/clang/ASTMatchers/ASTMatchers.h +++ include/clang/ASTMatchers/ASTMatchers.h @@ -195,11 +195,11 @@ /// 1, refersToType(asString("int")))) /// matches the specialization \c A AST_MATCHER_P2(ClassTemplateSpecializationDecl, hasTemplateArgument, - unsigned, n, internal::Matcher, Matcher) { + unsigned, N, internal::Matcher, Matcher) { const TemplateArgumentList &List = Node.getTemplateArgs(); - if (List.size() <= n) + if (List.size() <= N) return false; - return Matcher.matches(List.get(n), Finder, Builder); + return Matcher.matches(List.get(N), Finder, Builder); } /// \brief Matches a TemplateArgument that refers to a certain type. @@ -224,11 +224,11 @@ /// template struct A {}; /// struct B { B* next; }; /// A<&B::next> a; -/// ClassTemplateSpecialization(HasAnyTemplateArgument( -/// RefersToDeclaration(Field(HasName("next")))) -/// matches the specialization \c A<&B::next> with \c Field(...) matching +/// classTemplateSpecialization(hasAnyTemplateArgument( +/// refersToDeclaration(field(hasName("next")))) +/// matches the specialization \c A<&B::next> with \c field(...) matching /// \c B::next -AST_MATCHER_P(TemplateArgument, RefersToDeclaration, +AST_MATCHER_P(TemplateArgument, refersToDeclaration, internal::Matcher, Matcher) { if (const Decl *Declaration = Node.getAsDecl()) return Matcher.matches(*Declaration, Finder, Builder); @@ -740,7 +740,7 @@ return Node.getKind() == Kind; } -/// \brief Same as UnaryExprOrTypeTraitExpr, but only matching +/// \brief Same as unaryExprOrTypeTraitExpr, but only matching /// alignof. inline internal::Matcher alignOfExpr( const internal::Matcher &Matcher) { @@ -748,7 +748,7 @@ ofKind(UETT_AlignOf), Matcher))); } -/// \brief Same as UnaryExprOrTypeTraitExpr, but only matching +/// \brief Same as unaryExprOrTypeTraitExpr, but only matching /// sizeof. inline internal::Matcher sizeOfExpr( const internal::Matcher &Matcher) { @@ -779,8 +779,8 @@ } } -/// \brief Matches NamedDecl nodes whose full names match (PartialMatch) the -/// given RE. +/// \brief Matches NamedDecl nodes whose full names match partial match the +/// given RegExp. /// /// Supports specifying enclosing namespaces or classes by /// prefixing the name with '::'. Does not match typedefs @@ -1369,8 +1369,8 @@ /// Given /// int i[5]; /// void f() { i[1] = 42; } -/// ArraySubscriptExpression(HasIndex(IntegerLiteral())) -/// matches \c i[1] with the \c IntegerLiteral() matching \c 1 +/// arraySubscriptExpression(hasIndex(integerLiteral())) +/// matches \c i[1] with the \c integerLiteral() matching \c 1 AST_MATCHER_P(ArraySubscriptExpr, hasIndex, internal::Matcher, matcher) { if (const Expr* Expression = Node.getIdx()) @@ -1383,9 +1383,9 @@ /// Given /// int i[5]; /// void f() { i[1] = 42; } -/// ArraySubscriptExpression(HasBase(ImplicitCast( -/// HasSourceExpression(DeclarationReference())))) -/// matches \c i[1] with the \c DeclarationReference() matching \c i +/// arraySubscriptExpression(hasBase(implicitCast( +/// hasSourceExpression(declarationReference())))) +/// matches \c i[1] with the \c declarationReference() matching \c i AST_MATCHER_P(ArraySubscriptExpr, hasBase, internal::Matcher, matcher) { if (const Expr* Expression = Node.getBase()) @@ -1670,9 +1670,9 @@ /// matches \code using X::b \endcode AST_MATCHER_P(UsingDecl, hasAnyUsingShadowDecl, internal::Matcher, Matcher) { - for (UsingDecl::shadow_iterator it = Node.shadow_begin(); - it != Node.shadow_end(); ++it) { - if (Matcher.matches(**it, Finder, Builder)) + for (UsingDecl::shadow_iterator II = Node.shadow_begin(); + II != Node.shadow_end(); ++II) { + if (Matcher.matches(**II, Finder, Builder)) return true; } return false;