File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11
11
#include " spdlog/fmt/fmt.h"
12
12
13
13
#include " clang/AST/ASTContext.h"
14
+ #include " clang/AST/CXXInheritance.h"
14
15
#include " clang/AST/Decl.h"
15
16
#include " clang/AST/DeclCXX.h"
16
17
#include " clang/AST/DeclTemplate.h"
@@ -856,10 +857,9 @@ void TuIndexer::trySaveMemberReferenceViaLookup(
856
857
if (!recordDecl) {
857
858
return ;
858
859
}
859
- // FIXME(issue: https://github.com/sourcegraph/scip-clang/issues/296):
860
- // We should try to use more standard code which takes
861
- // inheritance into account.
862
- auto lookupResult = recordDecl->lookup (memberNameInfo.getName ());
860
+ auto lookupResult = recordDecl->lookupDependentName (
861
+ memberNameInfo.getName (),
862
+ [](const clang::NamedDecl *) -> bool { return true ; });
863
863
for (auto *namedDecl : lookupResult) {
864
864
auto optSymbol = this ->symbolFormatter .getNamedDeclSymbol (*namedDecl);
865
865
if (optSymbol) {
Original file line number Diff line number Diff line change 75
75
void ff0 () {
76
76
// ^^^ definition [..] ZZ#ff0(49f6e7a06ebc5aa8).
77
77
this ->f0 ();
78
+ // ^^ reference [..] Z#f0(49f6e7a06ebc5aa8).
78
79
}
79
80
80
81
template <typename U>
81
82
// ^ definition local 6
82
83
void gg0 () {
83
84
// ^^^ definition [..] ZZ#gg0(49f6e7a06ebc5aa8).
84
85
this ->f0 ();
86
+ // ^^ reference [..] Z#f0(49f6e7a06ebc5aa8).
85
87
this ->template g0 <U>();
88
+ // ^^ reference [..] Z#g0(49f6e7a06ebc5aa8).
86
89
// ^ reference local 6
87
90
}
88
91
};
Original file line number Diff line number Diff line change 25
25
// ^ reference local 2
26
26
// ^ definition local 3
27
27
this ->f0 (t);
28
+ // ^^ reference [..] T0#f0(9b289cee16747614).
28
29
// ^ reference local 3
29
30
}
30
31
35
36
// ^ reference local 4
36
37
// ^ definition local 5
37
38
this ->template g0 <U>(u);
39
+ // ^^ reference [..] T0#g0(b07662a27bd562f9).
38
40
// ^ reference local 4
39
41
// ^ reference local 5
40
42
}
You can’t perform that action at this time.
0 commit comments