File tree Expand file tree Collapse file tree 3 files changed +69
-2
lines changed Expand file tree Collapse file tree 3 files changed +69
-2
lines changed Original file line number Diff line number Diff line change @@ -857,9 +857,11 @@ void TuIndexer::trySaveMemberReferenceViaLookup(
857
857
if (!recordDecl) {
858
858
return ;
859
859
}
860
+ // Filter out UsingDecl as the corresponding UsingShadowDecl is sufficient.
860
861
auto lookupResult = recordDecl->lookupDependentName (
861
- memberNameInfo.getName (),
862
- [](const clang::NamedDecl *) -> bool { return true ; });
862
+ memberNameInfo.getName (), [&](const clang::NamedDecl *decl) -> bool {
863
+ return !llvm::isa<clang::UsingDecl>(decl);
864
+ });
863
865
for (auto *namedDecl : lookupResult) {
864
866
auto optSymbol = this ->symbolFormatter .getNamedDeclSymbol (*namedDecl);
865
867
if (optSymbol) {
Original file line number Diff line number Diff line change @@ -57,3 +57,22 @@ void g() {
57
57
using enum LongLongEnum;
58
58
using enum h::EvenLongerEnum;
59
59
}
60
+
61
+ namespace z {
62
+ struct U {
63
+ template <typename T>
64
+ T identity (T t) { return t; }
65
+ };
66
+
67
+ struct V : U {
68
+ int identity (int t, int ) { return t; }
69
+ using U::identity;
70
+ };
71
+
72
+ template <typename T>
73
+ struct W {
74
+ V v;
75
+
76
+ T identity (T t) { return v.identity <T>(t); }
77
+ };
78
+ }
Original file line number Diff line number Diff line change 117
117
// ^ reference [..] h/
118
118
// ^^^^^^^^^^^^^^ reference [..] h/EvenLongerEnum#
119
119
}
120
+
121
+ namespace z {
122
+ // ^ definition [..] z/
123
+ struct U {
124
+ // ^ definition [..] z/U#
125
+ template <typename T>
126
+ // ^ definition local 2
127
+ T identity (T t) { return t; }
128
+ // ^ reference local 2
129
+ // ^^^^^^^^ definition [..] z/U#identity(ada6a8422704cf8a).
130
+ // ^ reference local 2
131
+ // ^ definition local 3
132
+ // ^ reference local 3
133
+ };
134
+
135
+ struct V : U {
136
+ // ^ definition [..] z/V#
137
+ // relation implementation [..] z/U#
138
+ // ^ reference [..] z/U#
139
+ int identity (int t, int ) { return t; }
140
+ // ^^^^^^^^ definition [..] z/V#identity(9b79fb6aee4c0440).
141
+ // ^ definition local 4
142
+ // ^ reference local 4
143
+ using U::identity;
144
+ // ^ reference [..] z/U#
145
+ };
146
+
147
+ template <typename T>
148
+ // ^ definition local 5
149
+ struct W {
150
+ // ^ definition [..] z/W#
151
+ V v;
152
+ // ^ reference [..] z/V#
153
+ // ^ definition [..] z/W#v.
154
+
155
+ T identity (T t) { return v.identity <T>(t); }
156
+ // ^ reference local 5
157
+ // ^^^^^^^^ definition [..] z/W#identity(ada6a8422704cf8a).
158
+ // ^ reference local 5
159
+ // ^ definition local 6
160
+ // ^ reference [..] z/W#v.
161
+ // ^^^^^^^^ reference [..] z/V#identity(9b79fb6aee4c0440).
162
+ // ^ reference local 5
163
+ // ^ reference local 6
164
+ };
165
+ }
You can’t perform that action at this time.
0 commit comments