diff --git a/clang/lib/Index/DeclReferenceMap.cpp b/clang/lib/Index/DeclReferenceMap.cpp index 95de2ea7d0a3..3ec8794b379b 100644 --- a/clang/lib/Index/DeclReferenceMap.cpp +++ b/clang/lib/Index/DeclReferenceMap.cpp @@ -34,6 +34,7 @@ public: void VisitDeclStmt(DeclStmt *Node); void VisitDeclRefExpr(DeclRefExpr *Node); + void VisitMemberExpr(MemberExpr *Node); void VisitStmt(Stmt *Node); }; @@ -69,6 +70,11 @@ void StmtMapper::VisitDeclRefExpr(DeclRefExpr *Node) { Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node))); } +void StmtMapper::VisitMemberExpr(MemberExpr *Node) { + NamedDecl *PrimD = cast(Node->getMemberDecl()->getPrimaryDecl()); + Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node))); +} + void StmtMapper::VisitStmt(Stmt *Node) { for (Stmt::child_iterator I = Node->child_begin(), E = Node->child_end(); I != E; ++I)