File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,10 @@ struct TargetFinder {
189
189
D = USD;
190
190
Outer.add (D, Flags);
191
191
}
192
+ void VisitOverloadExpr (const OverloadExpr *OE) {
193
+ for (auto *D : OE->decls ())
194
+ Outer.add (D, Flags);
195
+ }
192
196
void VisitCXXConstructExpr (const CXXConstructExpr *CCE) {
193
197
Outer.add (CCE->getConstructor (), Flags);
194
198
}
Original file line number Diff line number Diff line change @@ -393,6 +393,32 @@ TEST_F(TargetDeclTest, Lambda) {
393
393
EXPECT_DECLS (" DeclRefExpr" , " auto int x = 1" );
394
394
}
395
395
396
+ TEST_F (TargetDeclTest, OverloadExpr) {
397
+ Code = R"cpp(
398
+ void func(int*);
399
+ void func(char*);
400
+
401
+ template <class T>
402
+ void foo(T t) {
403
+ [[func]](t);
404
+ };
405
+ )cpp" ;
406
+ EXPECT_DECLS (" UnresolvedLookupExpr" , " void func(int *)" , " void func(char *)" );
407
+
408
+ Code = R"cpp(
409
+ struct X {
410
+ void func(int*);
411
+ void func(char*);
412
+ };
413
+
414
+ template <class T>
415
+ void foo(X x, T t) {
416
+ x.[[func]](t);
417
+ };
418
+ )cpp" ;
419
+ EXPECT_DECLS (" UnresolvedMemberExpr" , " void func(int *)" , " void func(char *)" );
420
+ }
421
+
396
422
TEST_F (TargetDeclTest, ObjC) {
397
423
Flags = {" -xobjective-c" };
398
424
Code = R"cpp(
You can’t perform that action at this time.
0 commit comments