[PATCH] D42213: [ASTMatchers] [NFC] Fix code examples

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 05:51:06 PST 2018

aaron.ballman added a comment.

The documentation needs to be regenerated for this patch. One thing that seems to be inconsistent is with the "what gets matched" messages is that sometimes it includes extra adornments like curly braces and other times it does not. It might be good to pick a style and try to be more consistent with it.

Comment at: include/clang/ASTMatchers/ASTMatchers.h:1792
 /// switchStmt()
-///   matches 'switch(a)'.
+///   matches 'switch(a) {'.
 extern const internal::VariadicDynCastAllOfMatcher<Stmt, SwitchStmt> switchStmt;
I don't think this adds clarity.

Comment at: include/clang/ASTMatchers/ASTMatchers.h:1841
 /// cxxCatchStmt()
-///   matches 'catch(int i)'
+///   matches 'catch(int i) {}'
 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXCatchStmt>
I don't think this adds clarity.

Comment at: include/clang/ASTMatchers/ASTMatchers.h:1851
 /// cxxTryStmt()
-///   matches 'try {}'
+///   matches 'try {} catch(int i) {}'
 extern const internal::VariadicDynCastAllOfMatcher<Stmt, CXXTryStmt> cxxTryStmt;
I think this adds confusion.

  rC Clang


More information about the cfe-commits mailing list