File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -2303,7 +2303,15 @@ TEST(FindReferences, WithinAST) {
23032303 bool $decl[[operator]]"" _u^dl(unsigned long long value);
23042304 bool x = $(x)[[1_udl]];
23052305 )cpp" ,
2306- };
2306+ R"cpp(
2307+ struct S {
2308+ public:
2309+ static void $decl(S)[[operator]] delete(void *);
2310+ static void deleteObject(S *S) {
2311+ $(S::deleteObject)[[de^lete]] S;
2312+ }
2313+ };
2314+ )cpp" };
23072315 for (const char *Test : Tests)
23082316 checkFindRefs (Test);
23092317}
Original file line number Diff line number Diff line change @@ -153,6 +153,20 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
153153 ParentDC);
154154 }
155155
156+ bool VisitCXXNewExpr (CXXNewExpr *E) {
157+ if (E->isGlobalNew () || !E->getOperatorNew ())
158+ return true ;
159+ return IndexCtx.handleReference (E->getOperatorNew (), E->getBeginLoc (),
160+ Parent, ParentDC);
161+ }
162+
163+ bool VisitCXXDeleteExpr (CXXDeleteExpr *E) {
164+ if (E->isGlobalDelete () || !E->getOperatorDelete ())
165+ return true ;
166+ return IndexCtx.handleReference (E->getOperatorDelete (), E->getBeginLoc (),
167+ Parent, ParentDC);
168+ }
169+
156170 bool VisitLabelStmt (LabelStmt *S) {
157171 if (IndexCtx.shouldIndexFunctionLocalSymbols ())
158172 return IndexCtx.handleDecl (S->getDecl ());
You can’t perform that action at this time.
0 commit comments