[PATCH] D56849: [ASTMatchers][NFC] Update comments on assorted `CXXMemberCallExpr` matchers.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 17 07:48:01 PST 2019


aaron.ballman added a comment.

Some minor nits, but this is a good improvement!



================
Comment at: clang/docs/LibASTMatchersReference.html:4823
+  matches "x.m", but not "m"
+memberExpr(hasObjectExpression(hasType(pointsTo(
+     cxxRecordDecl(hasName("X"))))))
----------------
steveire wrote:
> If we're going to put such examples and details into the docs, maybe we should explain why things are and are not matched. What do you think?
> 
> It seems in this case the type of the object expression of `m` is `X*` because of the hidden `this->`?
I think that adding more clarity like this would be very nice.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2905
+/// cxxMemberCallExpr(on(callExpr()))
+///   matches `(g()).m()`
 ///
----------------
Missing a full stop.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5017
+/// memberExpr(hasObjectExpression(hasType(cxxRecordDecl(hasName("X")))))
+///   matches "x.m", but not "m"
+/// memberExpr(hasObjectExpression(hasType(pointsTo(
----------------
how about `matches "x.m", but not "m"; however,`


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:5020
+//      cxxRecordDecl(hasName("X"))))))
+///   matches "m", but not "x.m"
 AST_POLYMORPHIC_MATCHER_P(
----------------
Missing a full stop at the end of the sentence.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56849/new/

https://reviews.llvm.org/D56849





More information about the cfe-commits mailing list