File tree 2 files changed +23
-1
lines changed
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -2303,7 +2303,15 @@ TEST(FindReferences, WithinAST) {
2303
2303
bool $decl[[operator]]"" _u^dl(unsigned long long value);
2304
2304
bool x = $(x)[[1_udl]];
2305
2305
)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" };
2307
2315
for (const char *Test : Tests)
2308
2316
checkFindRefs (Test);
2309
2317
}
Original file line number Diff line number Diff line change @@ -153,6 +153,20 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
153
153
ParentDC);
154
154
}
155
155
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
+
156
170
bool VisitLabelStmt (LabelStmt *S) {
157
171
if (IndexCtx.shouldIndexFunctionLocalSymbols ())
158
172
return IndexCtx.handleDecl (S->getDecl ());
You can’t perform that action at this time.
0 commit comments