[PATCH] D48242: [ASTMatchers] Add support for matching the type of a friend decl.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 15 17:02:45 PDT 2018


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from some minor nits.



================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:2900-2904
+AST_POLYMORPHIC_MATCHER_P_OVERLOAD(
+    hasType,
+    AST_POLYMORPHIC_SUPPORTED_TYPES(Expr, FriendDecl, ValueDecl),
+    internal::Matcher<Decl>, InnerMatcher, 1) {
+  QualType QT = internal::getUnderlyingType(Node);
----------------
I actually prefer the previous formatting, can you restore that?


================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:128
+inline QualType getUnderlyingType(const FriendDecl &Node) {
+  if (const TypeSourceInfo *tsi = Node.getFriendType())
+    return tsi->getType();
----------------
tsi -> TSI


Repository:
  rC Clang

https://reviews.llvm.org/D48242





More information about the cfe-commits mailing list