Details
- Reviewers
sammccall - Commits
- rG1f8963c80195: [clangd] Parameter hints for dependent calls
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
| clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
|---|---|---|
| 267 | This is an interesting case. Clang builds a CXXDependentScopeMemberExpr for this callee, but HeuristicResolver currently assumes that such expressions are only built for non-static member accesses (since, for static member accesses, clang usually builds a DependentScopeDeclRefExpr instead). The CXXDependentScopeMemberExpr is created here, and I note the dependence on whether the enclosing context is an instance method. I guess it must think that, after instantiation, A<T> could turn out to be a base class, and thus this could be a "non-static member access with qualifier". I don't see anything obvious on CXXDependentScopeMemberExpr that would let us tell apart "definitely a non-static member" from "maybe static, maybe non-static", so I guess the appropriate solution is to drop the NonStaticFilter here altogether? | |
| clang-tools-extra/clangd/InlayHints.cpp | ||
|---|---|---|
| 56 | should we conservatively make this size != 1? | |
| clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
| 247 | can we add a test involving overloads? i think: void foo(int anInt);
void foo(double aDouble);
template <class T> go {
foo(T{}); // expect no hints
} | |
| 267 |
Argh, C++ is so tricky :-( That sounds plausible to me.
Yeah. The other thing is that some_instance.some_static_member is perfectly legal I think? So the NonStaticFilter is probably not correct anyway. | |
| clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
|---|---|---|
| 267 | This is sufficiently non-trivial to fix (requires more than just removing the filter) that I'll leave it for a separate patch / review. | |
should we conservatively make this size != 1?
e.g. if the callee ends up being an OverloadExpr of some kind, picking the first overload seems pretty arbitrary and maybe misleading.